My family has a card game that we've played ever since I was a child. The rules are simple, but the game itself can be played in several different ways.
The aim of the game is to be the first player to have played all of their cards. To get started, a standard deck of 52 cards (no jokers 🃏, please!) is first shuffled and then dealt equally between the players.
To identify which player shall go first, the players searches their hand for the 🃇 Seven of Diamonds. Whoever has that card then places it on the table for everyone else to see. From there, the players take turns - moving clockwise - to play a single card.
To play during your turn, you must play a card that is one higher or one lower than the cards on the table. If you do not have any such cards, you may place the Seven of another suit. For example, if there is only the 🃇 Seven of Diamonds on the table, the only valid moves are:
- 🃆 Six of Diamonds (one less)
- 🃗 Seven of Clubs (new suit)
- 🂷 Seven of Hearts (new suit)
- 🂧 Seven of Spades (new suit)
- 🃈 Eight of Diamonds (one more)
If you have a card that you can play, you must play it.
However, if you do not have any cards that can be played in this turn, you skip a turn by "knocking". This clearly indicates to the other players that you do not have a suitable card to play.
This is a project for me to learn both React and TypeScript. There will be alternative and unarguably better ways of implementing this game. If you have any feedback, feel free to raise an issue - I'm always interested to here your thoughts.