Skip to content

emilyrhee/snake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Requirements

The Snake Pit:

  • The snake pit is the area where the snake can move.
  • The snake pit must utilize all available space of the current terminal window.
  • There must be a visible border delineating the snake pit.

The Snake:

  • The initial length of the snake is three characters.
  • Initial direction of the snake's movement is chosen randomly.
  • The user can press one of the four arrow keys to change the direction of the snake's movement.
  • The snake's speed is proportional to its length.

The Trophies:

  • Trophies are represented by a digit randomly chosen from 1 to 9.
  • There's always exactly one trophy in the snake pit at any given moment.
  • When the snake eats the trophy, its length is increased by the corresponding number of characters.
  • A trophy expires after a random interval from 1 to 9 seconds.
  • A new trophy is shown at a random location on the screen after the previous one has either expired or is eaten by the snake.
  • A new trophy is shown at a random location on the screen after the previous one has either expired,
  • or is eaten by the snake.
  • Trophies should not spawn at the same coordinates of a snake segment

Gameplay:

The snake dies and the game ends if:

  • It runs into the border; or
  • It runs into itself; or
  • The user attempts to reverse the snake's direction.

The user wins if:

  • The snake's length grows to the length equal to half the perimeter of the border.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages