JMines
A simple Minesweeper clone that demonstrates a handful of programming concepts
Really? Minesweeper?
Yes. Really. It's for learning/teaching purposes. And it's a fun game.
GUI | CLI |
---|---|
![]() |
![]() |
What's to be learned here?
The idea is to have a well-documented, readable, Open Source implementation of a fun game nearly everyone knows. It's intended to be used for teaching Java and OOP in a class at the University of Cologne, but everyone's welcome to use it as a learning resource.
All this is still 🚧 work in progress! 🚧
- The game has both a GUI (graphical user interface) and a CLI (command line interface) completely indepentent of each other. The games' core doesn't care which interface it is communicating with. In fact, it doesn't even know. This teaches separation of concerns. And a bit of GUI programming, obviously.
- The game implements the MVC pattern (Model-View-Controller), as it clearly separates Model (the classes
GameState
andCell
), View (the user interfacesJMinesCli
andJMinesGui
) and Controller (the classJMines
) logic. - The user interfaces (views) and the core game logic class
JMines
(controller) don't need to "know each other". The whole communication is implemented using callback interfaces (straight from 1996!), effectively achieving inversion of control. - In all of the above, there's a lot of object oriented programming.
- Playing the game itself will teach you logical thinking.
Third party attribution
The game is currently using a handful of icons form icons8, so thanks for those icons! 👐