Skip to content

Rohanvp07/Snake-Game-in-C

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Snake Game in C 🐍

  • 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.

A Glimpse of the Game:

FormatFactory Screen Record20210308_192059 00_00_40-00_01_26

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages