What Building Four Browser Card Games Taught Me About State

typescript dev.to

I started with Spades. The rules engine worked, the computer players could finish a hand, and the score came out correctly. Then I watched an opponent play a card and saw its face change halfway across the table. Hearts found a different failure: the last trick of a round appeared twice. Euchre let a player go alone, but the sitting-out partner still looked active. Bridge could reach a valid contract and then stall because the human player was supposed to control Dummy rather than the seat at t

Read Full Tutorial open_in_new
arrow_back Back to Tutorials