Here you can find the following games developed in C and Python:
- Nim: you can run the code on https://onlinegdb.com/ajXKz_jMx. The computer will always win... at each turn write in input the number of elements you wish to remove) or use the command line writing
gcc <programName>.c
(in this casegcc Nim.c
) which will compile the file<programName.c>
and produce the output filea.out
, then./a
which will execute the code previously obtained. - Tris (i.e. tic-tac-toe): you can run the code on https://onlinegdb.com/eXkEZMznM ore use the command line with the same commands described above. At each turn enter the number corresponding to the position in the grid you would like to mark.
- Hanoi towers: you can run the code on https://onlinegdb.com/SYl7JCxPk or use the command line as previously described. You can try and change the number of discs by changing the global variable N_DISCHI 4 e.g. to N_DISCHI 5 which is the maximum number of discs possible in this implementation.
- Sudoku solver: A program (in Italian) to automatically solve sudokus. You can run the code on https://www.onlinegdb.com/IxcNlN-wH ore use the command line. To input any sudoku procede raw by raw putting 0 when a number is not given. As an example you can try the sudoku in the image above.
- Hangman: you can run the code on https://onlinegdb.com/Ym61-W2Qm or use the command line writing the command
python <programName.py>
(in this casepython hangman_game.py
). - Chess implemented from scratch in C++ (see the associated documentation in the corresponding folder).