Question: What to do ? Write a C program snake that implements the classic snake game. The snake pit: The snake pit is the area where
What to do
Write a C program snake that implements the classic snake game.
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 five 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 to
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 to 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.
The 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 the game if the snake's length grows to the length equal to half the perimeter of the border.
What to submit?
This project will have two milestones with different requirements:
Intermediate deliverable needs to have the following functionality: Must be submitted by April th
The game starts with the snake of size moving right;
Snake movement can be controlled in all directions;
Snake does not grow;
Snake pit border is visible;
No trophies.
Final deliverable: Must be submitted by the day of your presentation
All functionality listed in "What to do section is required.
For each deliverable you will need to submit the following:
A single C source code file with your work.
A video screencast showing a representative gameplay sequence. The video should be no longer than minutes.
PLEASE WRITE THE CODE THAT MEETS THE REQUIREMENTS OF THE FIRST DELIVERABLE. DO IT IN THE C PROGRAMMING LANGUAGE
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
