TUI Minesweeper


Created a TUI version of Minesweeper, check it out here.

My wife and I both got interested in Minesweeper this last week so I decided to make my own version. I also added multiplayer support! (Check out the multiplayer branch of the code, thought it does need some cleanup on the host/join logic.)


This is the first game I’ve written (obvously I didn’t invent the idea or anything), this is subsiquently also the first multiplayer game I’ve written. It was interesting to see the complexity of the program increase drastically by adding multiplayer.

The single player version is just one 385 line rust file. Whereas the multiplayer version is now 5 files and 1115 lines. Part of this is because I didn’t want to do something cringe like just sending game state with json objects. If I had done this I could’ve saved several hundred lines of code, but then the networking would be bloated. It was also more fun to create bit flags for bounding the data being sent. I also can send the whole gamestate in <100 bytes.


Tags: