Implemented the game logic of a simple GUI game.

The GUI still has to be built, though.