Marienbad Help.
The Marienbad game is a variant of the classic Nim game and the application Marienbad is a free implementation of this game for PC. The rules of Marienbad are as follows:
- 16 matches are placed in 4 rows (on 4 heaps), the number of matches per row being respectively: 1, 3, 5, 7.
- The two players alternately remove one or more matches.
- Matches may only be removed from a single row.
- It is up to the player to decide how many matches they take: at least one, at most all (the whole row).
- In one of the versions of the game (called Nim variant in the application), the player, who takes the last match, wins.
- In another version of the game (called Misere variant in the application), the player, who takes the last match, looses.
New.
Start a new Marienbad game with the options actually selected.
Exit.
Exit the Marienbad application.
Game options, in particular if you want to play the Nim or the Misere variant of the game. Note, that new settings in the options menu only become active, after a new game has been started in the New menu.
Game variant.
Select, if you want to play the Nim variant (last match wins) or the Misere variant (last match looses). Default at application startup: Nim.
Computer strength.
Select the strength (level) with which the application should play. Possible options: Beginner, Intermediate, Expert (cf. Computer strength for details). Default at application startup: Intermediate.
First move.
Select who should move first. Possible options: Computer (the program), Player (yourself) and Random (the application randomly chooses if the program or the player plays first). Default at application startup: Computer.
Matches removal.
Select, what happens if you remove a match. If Remove is selected, the match is effectively removed; using this option makes the application look more realistic (as if you played with real matches). If Strike through is selected, the match remains where it was, but is stroked through to mark that it has been removed; using this option, makes it easier to mentally calculate the Nim sums in order to determine the winning move. But, it has another advantage, offering an Undo functionality (cf. Playing the game for details). Default at application startup: Strike through.
Help.
Displays usage help for the Marienbad application (this text) in your web browser.
About.
Displays version, author and date-written of the Marienbad application.
Select the game settings (in particular if you want to play the Nim or the Misere variant) and choose New in the Game menu. If the computer plays first, push the Start button to make the computer make the move. If the player plays first, and after the first computer move, the button is labeled Nim. Click the matches, that you want to remove. If Matches removal is set to Remove, the clicked match is removed, otherwise it is stroked through with a red bar (cf. below). When you are done, push the Nim button. If the last match has been removed, you are told if you win or loose, otherwise the computer (immediately, without any button push) makes the next move. If this removes the last match, you are told who wins, otherwise, it's your turn again.
If Matches removal is set to Strike through, the removed matches remain present, but are stroked through with a colored bar. Matches removed by the computer are marked with a blue bar, matches actually being removed by the player with a red one, matches that have been removed by the player during the previous turns by a black one. The Strike through display includes an Undo functionality: If you click a match actually removed (i.e. marked with a red color bar), the removal is undone, the match being made part of the game again.
The Nim game in general and the Marienbad game in particular are games where one of the players, when playing without making any mistake, always wins (thus, the other one always looses). For both variants of Marienbad, the player, who starts the game, will always loose, if the other player makes the optimal moves. Marienbad may be mathematically solved and so it is possible to write a winning algorithm, that allows the computer to win all games, where the player makes the first move. To give the player a possibility to win such games, the program must support several game levels, where the computer plays with different strength. Except for the full strength level, the program more or less often makes a mistake, by making a random move instead of making the one, that would win the game.
The Marienbad PC application allows to make the computer play with one of three different strengths:
- Expert: The computer plays at full strength (following the winning algorithm for all moves). Thus, if the player starts the game, they always loose; if the computer starts the game, the player wins if they play without mistake, but making one single mistake, the computer will win the game.
- Beginner: This level, intended for people that never played Nim before or for young children, is somewhat the contrary of Expert: The program makes random moves during the entire game and the player has all chances to win. Not entirely true: If there is one single row of matches left and the number of matches is such that the program will win when making the correct move, it will make it.
- Intermediate: Strong players would probably prefer to play the game with the computer beginning the game and playing at full strength, giving them the possibility to always win, but only if they play without making any mistake. Less strong players should select the Intermediate computer strength. Except, towards the end of the game, the program makes at a ca 50% ratio a random move (and, if there actually is one, the winning move for the other 50%). When there are only two rows of matches left or when all rows contain exactly one match, the program doesn't make random moves anymore, i.e. plays at the full strength.
For any suggestions or comments, please send me an email. This is in particular true, if you should win a game in the case where the program plays with Expert strength and you made the first move. This should not be possible and if it nevertheless happened, it would mean that there is a bug in my winning algorithm.