Tenzies

A React dice game where you hold dice and keep rolling until all ten show the same number.

Screenshot of Tenzies

About this project

Tenzies, a dice game built with React: roll ten dice, hold the ones you want to keep, and win when all ten match.

Key features:

  • Click a die to hold it; held dice stay green and are skipped on the next roll
  • Win detection when every die is held and shows the same value
  • Confetti and a win sound when you finish, with the button turning into New Game
  • Focus moves to the New Game button automatically after a win, for keyboard users

Engineering:

  • React hooks: useState with lazy initialization, useEffect, and useRef for the audio and focus