0% found this document useful (0 votes)
20 views15 pages

Sathvika

The document describes a project report on developing a snake game. It includes sections on introduction, objectives, requirements, analysis, algorithm, flowchart, implementation and output screens. The project aims to create a basic console snake game using C language where the player controls a snake to eat food while avoiding hitting borders or itself.

Uploaded by

vedadarbar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views15 pages

Sathvika

The document describes a project report on developing a snake game. It includes sections on introduction, objectives, requirements, analysis, algorithm, flowchart, implementation and output screens. The project aims to create a basic console snake game using C language where the player controls a snake to eat food while avoiding hitting borders or itself.

Uploaded by

vedadarbar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

A PROJECT REPORT

ON

Snake Game

Submitted by

G. Sathvika - 23RH1A05Q0
G. Pravalika - 23RH1A05Q1
G.Haritha - 23RH1A05Q2

Department of Humanities and Sciences

MALLAREDDY ENGINEERING COLLEGE FOR WOMEN


(Autonomous Institution-UGC, Govt. of India)
NIRF Indian Ranking-2018&2020, Accepted by MHRD, Govt. of India
Band Excellent National Ranking by ARIIA, MHRD, Govt. of India
Accredited by NBA &NAAC with ‘A’ Grade UGC, Govt. of India
Affiliated to JNTUH, Approved by AICTE, ISO 9001:2015 Certified Institution
AAAA+ Rated by Digital Learning Magazine, AAAA Rated by Careers 360 Magazine
Maisammaguda, Dhullapally, Secunderabad, Kompally-500100

DECEMBER 2023

MALLA REDDY ENGINEERING COLLEGE FOR WOMEN


(Autonomous Institution-UGC, Govt. of India)
NIRF Indian Ranking-2018&2020, Accepted by MHRD, Govt. of India
Band Excellent National Ranking by ARIIA, MHRD, Govt. of India
Accredited by NBA &NAAC with ‘A’ Grade UGC, Govt. of India
Affiliated to JNTUH, Approved by AICTE, ISO 9001:2015 Certified Institution
AAAA+ Rated by Digital Learning Magazine, AAAA Rated by Careers 360 Magazine
Maisammaguda, Dhullapally, Secunderabad, Kompally-500100
__________________________________________________________
CERTIFICATE

This is to certify that this is the bonafied record of the project titled
“SNAKE GAME” submitted by

G.Sathvika (23RH1A05Q0)
G.Pravalika (23RH1A05Q1)
G.Haritha (23RH1A05Q2)

Of First year B. Tech, in the partial fulfillment of the requirements for the degree
of Bachelor of Technology in Electronic and communication Engineering during
the year 2023-2024. The results embodied in this project report have not been
submitted to any other university or institute for the award of any degree or
diploma.

INTERNAL GUIDE HOD


Mr.Sundar Ratnam Dr. A. Swarupa Rani
ACKNOWLEDGEMENT

We feel ourselves honored and privileged to place our warm salutation to our college Malla
Reddy Engineering College for Women and department of Electronic and Communication Engineering
which gave us the opportunity to have expertise in engineering and profound technical knowledge.

We would like to convey thanks to our internal project guide Mr.SUNDAR RATNAM for her
regular guidance and constant encouragement and we are extremely grateful to her for her valuable
suggestions and unflinching co-operation throughout project work.

we express our heartiest thanks to Dr. A. SWARUPA RANI, Head of the Department, H&S
for encouraging us in every aspect of our project

We wish to convey gratitude to our Principal Dr. Y. MADHAVEE LATHA, for providing us
with the environment and means to enrich our skills and motivating us in our endeavor and helping us
realize our full potential.

With Regards and Gratitude

G. Sathvika (23RH1A05Q0)
G. Pravalika (23RH1A05Q1)
G.Haritha(23RH1A05Q2)
ABSTRA
CT

snake game is a computer action game, whose goal is to control a snake to move and collect food
in a map. In this paper we develop a controller based on movement rating function considering
smooth less, space, and food.

Scores given by these functions are aggregated by linear weighted sum, and the snake takes the
action that leads to the highest score. To find a set of good weight values, we apply an
evolutionary algorithm. We examine several algorithm variants of different crossover and
environmental selection operators. Experimental results show that our design method is able to
generate smart controllers.
INDEX

Title Page no

Abstract

1. Introduction 1-2

2. Requirements 3

3. Analysis 4

4. Algorithm 5

5. Flowchart 6

6. Implementation 7

7. Output Screens 8

8. Conclusion and Future Enhancement 9

9. References 10
Introduction:

The game called “snake” or “snake game” typically involve the player controlling a line or
snake, there is no official version of the game, so gameplay varies. The most common version of
the game, involves the snake or line eating items which make it longer, with the objective being
to avoid running into a border or the snake itself for as long as possible.

The player loses when the snake either runs into a border or its own body. Because of this, the
game becomes more difficult as it goes on, due to the growth of the snake.

Nokia has installed the “snake game” on many of its phones. The game is also available on
several websites, including You tube, which allows viewers to play the game while a video
loads.

This snake game is a basic console program with no graphics. Food is placed at various
co-ordinates on the screen for the snake to consume. The snake’s length and score will both rise
by one element each time it consumes the food.
Objectives:

 This project in C language of Snake Game is a simple console application with very simple
graphics. In this project, you can play the popular “snake game” just like you played it
elsewhere. You have to use the up, down, right or left arrows to move the snake.
 Foods are provided at the several co-ordinates of the screen for the snake to eat. Every
time the snake eats the food, its length will by increased by one element along with the
score.
 It isn’t the world’s greatest game, but it does give you an idea of what you can achieve with
a relatively simple c program, and perhaps the basis by which to extend the principles and
create more interesting games of your own.
 The aim of the game is to collect the dots and avoid the obstacles, there is no concept of
lives. Once you hit an obstacle, that’s it, game over.
Requirements:

Hardware Requirements:

1. RAM 4GB
2. HARDDISK 1TB
3. PROCESSOR PENTIUM I5

Software Requirements:

1. Operating System: Windows XP


2. DEV C++ IDE
Analysis:

Analyzing a snake game in C involves reviewing the code structure, logic, and key
functions.

Initialization:

Set up the game board(grid).


Initialize the snake with a starting position and direction.
Place the first food item randomly on the grid.

Game loop:

Continuously take input from the user to change the snake’s direction (up, down, left, right).
Update the snake’s position based on its current directions.

Check for collisions:

If the snake collides with itself or the game boundaries, end the game.
If the snake reaches the food, increase its length and place a new food item randomly.

Data structures:

Use an array to represent the game board.


Maintain an array or a linked list to represent the snake, storing its segments positions. Store the
current direction of the snake.

Functions:

Function to initialize the game board and snake.


Function to handle user input and update the snake’s direction.
Function to move the snake based on its current direction.
Function to check for collisions.
Function to place food randomly on the grid.
Function to update and display the game board.

Algorithm:
Step 1: Initialize game board and snake

Step 2: Game loop

Step 3: Take user input and update snake

Step 4: Move the snake

Step 5: Check for collisions

Step 6: Place food if needed

Step 7: Display the updated game board

Step 8: Delay the control game speed

Flowchart:
Implementation:
#include<stdio.h>
#include<stdlib.h>
int i, j, height=30;
int width=30, game over, score;
void draw()
{
for(i=0;i<height;i++)
{
for(j=0;j<width;j++)
{
if(i==0||i==width-1||j==0||j==height-1)
{
printf(“#”);
}
else
{
printf(“”);
}
}
printf(“\n”);
}
}
int main()
{
draw();
return 0;
}
Output screens:
Conclusion:

 The project in c language of snake game is a simple console application with very simple
graphics. In this project, you can play the popular “snake game” just like you played it
elsewhere. You have to use the up, down, right or left arrows to move the snake.
 Foods are provided at the several co-ordinates of the screen for the snake to eat. Every
time the snake eats the food, its length will by increased by one element along with the
score.
 It isn’t the world’s greatest game, but it does give you an idea of what you can achieve
with a relatively simple c program, and perhaps the basis by which to extend the
principles and create more interesting games of your own.

Future Enhancements:
 Our project will be able to implement in future after making some changes and
modifications as we make our project at a very low level. So the modifications that can be
done in our project are:

1. It can be made with good graphics.


2. We can add more options like top scores and player profile.
3. We can add multiplayer option.
References:

 https://en.wikipedia.org/wiki
 https://www.youtube.com
 https://www.cs.bham.ac.uk

Books:
a. Let us C by Yashwant kanetkar
b. Programming with C by E Balagurusamy
c. Graphics under C by Yashwant kanetkar

You might also like