This is a memory game made with Emojis, and it is my first project using React. Click through the cards to find the matching pair and complete the game. Hit the reset button if you’d like to start fresh.
React
JavaScript
CSS
- Fork this respository
Click the Fork button on the upper right-hand side of this repository's page. - Clone the repository
Under the repository name, click on the code button and copy the clone URL for the repository. - Run the file
npm start
import React from "react"
import './App.css';
import MemoryCard from "./components/MemoryCard.js"
const generateDeck = () => {
const symbols = ["🐶", "🐼", "🐸", "🐙", "🐷", "🐻", "🐝", "🐲"]
let deck = []
for (let i = 0; i < 16; i++) {
let aCard = {
isFlipped: false,
symbol: symbols[i % 8]
}
deck.push(aCard)
}
return shuffle(deck)
}
class App extends React.Component {
constructor(props) {
super(props)
this.state = {
deck: generateDeck(),
pickedCards: [],
newPickedCards: []
}
}
This project is under MIT license. See the license for more information.