Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C Snake Game

A doubly-linked list based snake clone written in C.

  • The snake is represented as a doubly-linked list, where each section is a node.
  • Moving forwards involves popping the tail node from the list, and prepending it to the head. Its coordinates are then modified in respect to the direction the snake is moving.
  • When an apple is touched, its new position is randomized (ensuring that the apple is not spawned on the snake)
  • Adding to the snake allocates the memory for a new node, and prepends it to the snake, becoming the new head.
  • The game is written using ncurses for keyboard input and improved screen printing to terminal

Example

Example Snake Image

  • The game board size can be set in the header file
  • Touching the walls or running into your tail ends the game.

About

A doubly-linked list snake game written in C

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages