June 2015
Beginner
354 pages
8h 23m
English
We have prepared the game environment in the last example and decided the game logic should be the same as playing a real deck. It is time to code the JavaScript logic now:
js/matchgame.js file.js/matchgame.js file. The array declares six pairs of card patterns:var matchingGame = {};
matchingGame.deck = [
'cardAK', 'cardAK',
'cardAQ', 'cardAQ',
'cardAJ', 'cardAJ',
'cardBK', 'cardBK',
'cardBQ', 'cardBQ',
'cardBJ', 'cardBJ',
];Read now
Unlock full access