You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Quentin Barrand a678dfbde7 Improved detection of game ending (win / lost). 7 years ago
doc Initial commit 7 years ago
lib Removed useless pointers to curses' window in function prototypes. 7 years ago
src Improved detection of game ending (win / lost). 7 years ago
.travis.yml Added .travis.yml for automated build on Travis CI. 7 years ago
LICENSE Updated LICENSE to remove a useless part. 7 years ago
Makefile Corrected an issue in Makefile. 7 years ago
README Added the coup type. 7 years ago
README.md Added the build status PNG from Travis CI into GitHub's README.md. 7 years ago
documentation.dox Updated documentation for the Stack and coordutils modules. 7 years ago
main.c Corrected includes so the app compiles normally. 7 years ago

README.md

C implementation of the Solitaire game

This is a project I made during my first semester at ENSIIE to learn the C language.

The subject was the following :

  • Code a solitaire game (release 1.0);
  • Recode it using modules and add the ability for the user to import his own checkerboard (release 2.0);
  • Recode it using ncurses (release 3.0).

Compilation Automated build by Travis CI

Very simply, using make : $ make.
If you want to get all the debug feature and symbols, just call the dev target instead : $ make dev

Usage

$ ./solitaire [options]

Options:
-h Prints this help and exits.
-n Allows vertical and horizontal moves (default).
-d Allows diagonal moves.
<str> Path to the configuration file (read nex section).

Configuration file

The game uses the following checkerboard as the default :

     A  B  C  D  E  F  G
   ---------------------
1 |           #
2 |     #  #  #  #  #
3 |     #     #     #
4 |  #  #  #  -  #  #  #
5 |     #     #     #
6 |     #  #  #  #  #
7 |           #

You can specifiy the checkerboard you wan to play on by passing its path as an argument of the application. The format should be the following :

  • * for a case that is occupied by a pawn (#);
  • . for an empty case (-);
  • V or v for a case that isn’t playable.

For example, this model :

**.**
**.** 
**v**

will give the following checkerboard :

     A  B  C  D  E
   ---------------
1 |  #  #  -  #  #
2 |  #  #  -  #  #
3 |  #  #     #  #

Beware ! Configuration file should not exceed 26 lines in height and 26 columns in width.

Copying / License

This free software is provided under the terms of the GNU General Public License 2. A copy of the license is integrated in the repo.