Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 930 Bytes

File metadata and controls

28 lines (22 loc) · 930 Bytes

Helps

How to generate matrix with set of random values

  1. You should have a set of values for Card.
    Example:
  const valuesOfCard = ['A','B','C','D', 'E', 'F']
  1. Based on difficulty of game create temporary array of values for game
Difficulty Elements in array
easy 16(4x4)
medium 36(6x6)
hard 64(8x8)

After this step you should have:

  //for easy game 
  const cardsData = ['A','A','B','B','C','C','D','D','E','E','F','F','A','A','B','B']
  1. Than shuffle this array:
  1. And the last step set values from cardsData array to your fields array of arrays