This project implements the famous Marienbad game in Java. It includes two versions: a two-player game and a player vs. bot game.
- Thibault FALEZAN
- Augustin LETANG
The project consists of two main files:
Marienbad.java: Implements the two-player version of the game.MarienbadBot.java: Implements the player vs. bot version of the game.
Marienbad is a strategic game where players take turns removing sticks from different rows. The player who removes the last stick won the game.
- Interactive command-line interface
- Colorful ASCII art for the game title
- Dynamic game board display
- Input validation and error handling
- Unit tests for core game logic
- Run the game (either
Marienbad.javaorMarienbadBot.java). - Choose to start the game or run unit tests.
- Enter player names and game parameters as prompted.
- Take turns removing sticks from the rows.
- The game ends when a player removes the last stick.
- Two human players compete against each other.
- Players take turns removing sticks.
- One human player competes against a computer-controlled bot.
- The bot makes random moves.
- The game uses ANSI escape codes for colored output in the terminal.
- The game board is represented as an array of integers, where each element represents the number of sticks in a row.
- Input validation ensures that players make legal moves.
Both versions include unit tests for the following methods:
generateLinesContent(): Tests the initial game board generation.playerWon(): Tests the win condition detection.
To run the tests, choose option 'b' from the main menu.
Here are some screenshots of the game in action:
This project was created as part of a programming assignment to evaluate our skills at the IUT Informatique de Vannes.

