You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The snake is represented with an *(asterisk) symbol.
The fruit is represented with an @(at sign) symbol.
The snake can move in any direction according to the user with the help of the keyboard (:arrow_down:, :arrow_up:, :arrow_left:, :arrow_right: keys).
When the snake eats a fruit the score will increase by 1 point βοΈ.
The fruit will generate automatically within the boundaries π π π.
Whenever the snake will touch the boundary the game is over β.
Built-in functions used:
kbhit(): This function in C is used to determine if a key has been pressed or not. To use this function in a program include the header file conio.h. If a key has been pressed, then it returns a non-zero value otherwise it returns zero.
rand(): The rand() function is declared in stdlib.h. It returns a random integer value every time it is called.