Skip to content

Epitech project :A game of matchstick against an AI in C

Notifications You must be signed in to change notification settings

ArthurBoucard/CPE_matchstick

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodeFactor

Matchstick

Epitech project :

A game of matchstick against a small AI in C.


🎮 How to play :

• 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.


💻 How to run :

./matchstick x y
   x = number of lines
   y = max amount of matches that can be removed

❗ Rules :

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.


Exemple of a 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

About

Epitech project :A game of matchstick against an AI in C

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published