Skip to content

Programs in C and Python to play some simple games (Nim, Tic-tac-toe, Hanoi towers, Chess and Hangman)

Notifications You must be signed in to change notification settings

leonardoLavagna/Games

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Games

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 case gcc Nim.c) which will compile the file <programName.c> and produce the output file a.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 case python hangman_game.py).
  • Chess implemented from scratch in C++ (see the associated documentation in the corresponding folder).

About

Programs in C and Python to play some simple games (Nim, Tic-tac-toe, Hanoi towers, Chess and Hangman)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published