Coder Social home page Coder Social logo

memory-game's Introduction

Tech Memory

Technologies

Tech Memory is built using the following technologies:

  1. HTML
  2. jQuery
  3. Font-Awesome for the icons

Approach Taken

  1. Create an array to store all the icons. There are 12 pairs.
  2. Randomly shuffle the icons in the array.
  3. For each icon in the array, create each tile as a div within the "memory_board" div.
  4. Allow each user to click only up to 2 tiles at a time.
  5. If the 2 tiles match, add the player's colour to them, update the score and keep track of the number of tiles uncovered. Let the same player continue playing.
  6. If the 2 tiles do not match, switch players. Cover back the tiles after 700 ms.
  7. When all the tiles have been clicked, present the score in a dialog box and reset the game.

Instructions

  1. When the page loads, Player 1 always starts first as indicated by his label being shown in red. Player 1 can click any 2 tiles to display the respective icons.
  2. If this results in a match, Player 1 continues playing.
  3. If not, it is now Player 2's turn. Similarly, Player 2 keeps his/her turn as long as he/she continues uncovering matches.
  4. The relevant scores are updated during gameplay.
  5. If you want to reset the game at anytime, click on the reset button.
  6. The game ends when all tiles have been uncovered.

Link to the Game

memory-game's People

Contributors

charlesguo avatar

Watchers

 avatar James Cloos avatar

Forkers

hakimishere

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.