- But the board was fixed to 10x10, and would count mines by wrapping around. Need to convert to a 2d board.
- But the bomb rng is a bit skewed, all the bombs are placed towards the top. Check to make sure it's an even chance.
- Fixed by changing the boundaries from squares.length (which was originally working but we made it 2d) to width * height
- Board and bomb placement is now fixed
Changed color scheme to better differentiate hidden, revealed, and flagged tiles
- Uses React.syntheticEvent and e.preventDefault() to get the right click flag to work
- Had a 1-behind error due to using setState, so moved it into a function to recalculate the message every render
- Moved to useEffect() - this takes in a dependency and runs a function each time it is changed. Used this to manually update the game status each time we modify win/loss/bombs remaining
- Convert to useEffect?
Bombs now generate on first reveal, making sure that the user never clicks a bomb on their first try
Added mysql database with crud operations & apis to allow users to submit scores to a leaderboard, which is shown on a separate page
- But I couldn't figure out how to set up an external database with vercel and vercel uses postgres by default, so that part isn't going into the live deployment. Check out the mysql-leaderboard branch instead.