A game of matchstick against a small AI in C.
• There is a certain number of matchstick lines.
• The two players take turns; each player can, on a same line, take at least one or several matchsticks.
• The losing player is the one to take the last matchstick.
./matchstick x y
x = number of lines
y = max amount of matches that can be removed
The basic version must generate a game board with n matchstick lines (1 < n < 100).
When matchsticks are removed, they must be removed starting from the right.
The user will always start the game.
$> ./matchstick 4 5
*********
* | *
* ||| *
* ||||| *
*|||||||*
*********
Your turn:
Line: 4
Matches: 2
Player removed 2 match(es) from line 4
*********
* | *
* ||| *
* ||||| *
*||||| *
*********
AI's turn...
AI removed 2 match(es) from line 3
*********
* | *
* ||| *
* ||| *
*||||| *
*********
...
Your turn:
Line: 4
Matches: 2
Player removed 2 match(es) from line 4
*********
* *
* *
* *
*| *
*********
AI's turn...
AI removed 1 match(es) from line 4
*********
* *
* *
* *
* *
*********
I lost... snif... but I'll get you next time!!
Made in C