Няма описание

Евгения Акиншина 02aed8655d first commit преди 2 години
public 02aed8655d first commit преди 2 години
src 02aed8655d first commit преди 2 години
.DS_Store 02aed8655d first commit преди 2 години
.gitignore 02aed8655d first commit преди 2 години
README.md 02aed8655d first commit преди 2 години
package-lock.json 02aed8655d first commit преди 2 години
package.json 02aed8655d first commit преди 2 години
tsconfig.json 02aed8655d first commit преди 2 години

README.md

Memory Game Using TypeScript and React

To run the app -

In the project directory, you can run:

npm install

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

Things done

A React TS application that is used to play the memory game with the help of useReducer

Algorithm -

  1. The player will start the game
  2. he/she will click on a card
  3. once clicked the it will get checked with the last card(which initially is none)
  4. if the two cards matches, both the cards will remain open othervise the older card will be closed
  5. the process will repeate it we see all the cards open
  6. when all the cards are opened
  7. the user will get a message box indicating "congrats, you won"
  8. the player can play the game again by clicking on the restart game button

I have use useReducer, useEffect and useState to save the states. These are called Hooks (such as a useReducer hook) they store the recent addition to React that enable more of your components to be written as functions by providing less complex alternatives to class features. One significant advantage is that typing function components in TypeScript is simpler and more direct.

Screens

INITIAL-

Initial Screen

MID-

Mid Screen

RESULTS-

Result Screen