|
|
1 yıl önce | |
|---|---|---|
| src | 1 yıl önce | |
| README.md | 1 yıl önce | |
| compile.sh | 1 yıl önce |
A simple snake game in the terminal. No third party libraries needed.
Click image for video
The program makes the terminal use non-canonical input and output by using termios. Then it updates and prints a 2D character array containing the board borders, snake, and food. Before terminating, the program restores canonical mode.
Each part of the snake is a node of a dynamically allocated linked list that contains:
An order keeps information on when the direction of the snake part has to change and to which direction it should change. An order is also a node in a dynamically allocated linked list that contains:
Only tested and designed to work with the combination of