SNAKE GAME
Submitted in fulfillment of the requirements of
micro-project
SNAKE GAME
BY
“Prachi Jadhav”
“Sharayu Jadhav”
“Siddhi Jadhav”
“Vaishnavi Jadhav”
ROLL NO:- 21
22
23
24
ENROLLMENT NO:- 23112120242
23112120243
23112120244
23112120245
SUBJECT INCHARGE
Mr. Urvesh Ghude
Computer Engineering Department
Academic Year 2024-2025
CERTIFICATE
This is to certify that the microproject
SNAKE GAME
Is done by
“Prachi Jadhav”
“Sharayu Jadhav”
“Siddhi Jadhav”
“Vaishnavi Jadhav”
is submitted for
“Snake Game”
for
the diploma in Computer Engineering to the
Maharashtra State Board of Technical Education,
Mumbai (Autonomous) (ISO-9001-2008) (ISO/IEC 27001:2013)
Subject Incharge Head of Department
(Mrs. Urvesh Ghude) (Mrs.Smita Kuldiwar)
' Snake game '
Submitted in fulfillment of the requirements
of micro-project
Snake game
By
Process and Individual
Roll Name Enrollment product Presentation/ Total(10)
No No assessment work
(6 Marks) (4 marks)
21
Prachi Jadhav 23112120242
22
Sharayu 23112120243
Jadhav
23
Siddhi Jadhav 23112120244
24
Vaishnavi 23112120245
Jadhav
SUBJECT INCHARGE
Mr. Urvesh Ghude
Computer Engineering Department
Academic Year 2024-2025
COMPUTER ENGINEERING DEPARTMENT
VISION AND MISSION OF THE PROGRAMME
Vision: -
To provide technically competent and skilled diploma computer
engineers to fulfill the needs of industry and society.
Mission: -
M1:- To provide industry oriented quality education and training.
M2:- To impart and inculcate theoretical and practical knowledge.
M3:- To provide interpersonal skills and social ethics.
COMPUTER ENGINEERING DEPARTMENT
PROGRAMME OUTCOMES
PO1: Basic and Discipline specific knowledge: Apply knowledge of basic mathematics,
science and engineering fundamentals and engineering specialization to solve the engineering
problems.
PO2: Problem analysis: Identify and analyze well-defined engineering problems using
codified standard methods.
PO3: Design/ Development of solutions: Design solutions for well-defined technical
problems and assist with the design of systems components or processes to meet specified
needs.
PO4: Engineering Tools, Experimentation and Testing: Apply modern engineering
tools and appropriate technique to conduct standard tests and measurements.
PO5: Engineering practices for society, sustainability and environment: Apply
appropriate technology in context of society, sustainability, environment and ethical
practices
PO6: Project Management: Use engineering management principles individually, as a
team member or a leader to manage projects and effectively communicate about well-
defined engineering activities.
PO7: Life-long learning: Ability to analyze individual needs and engage in updating
in the context of technological changes
COMPUTER ENGINEERING DEPARTMENT
PROGRAMME EDUCATIONAL OBJECTIVES
PEO1: Provide socially responsible, environment friendly solutions to
Computer engineering related broad-based problems adapting professional ethics.
PEO2: Adapt state-of-the-art Computer engineering broad-based technologies to
work in multidisciplinary work environments.
PEO3: Solve broad-based problems individually and as a team member
communicating effectively in the world of work.
PROGRAMME SPECIFIC OUTCOMES
PSO1: Computer Software and Hardware Usage: Use state-of-the-art technologies
for operation and application of computer software and hardware.
PSO2: Computer Engineering Maintenance: Maintain computer engineering
related software and hardware systems.
Aim SNAKE GAME
Course Outcomes
1. Understand fundamental concepts of computer graphics.
2. Apply graphic design software tools
3. Develop 2D and 3D graphics.
Proposed Methodology
● First, Search the topic for which you want to make a project, and then propose it to the
Subject In charge.
● After finalizing the topic, start gathering the information about your project.
● For Program Execution, write the source code of your program in any suitable IDE.
● Recheck the program with the subject in charge.
● Now, it’s time to make a report of your Selected Project.
Action Plan
Sr. Detail of activity Plan Start Date Plan Finish Date
No.
1. Searching of Topic 04-08-2024 06-08-2024
2. Gathering information 09-08-2024 13-08-2024
3. Execution of Program 15-08-2024 22-08-2024
4. Report Making 05-09-2024 12-09-2024
Subject In-charge
(Mrs.Urvash Ghude)
SNAKE GAME
Rationale
In C graphics, the graphics.h functions are used to draw different shapes like circles,
rectangles, etc, display text in a different format or different fonts and colors. By using the
functions in the header graphics.h, programs, animations, and different games can also be made.
Literature
Computer Graphics is the process of creating images using computers. It
involves algorithms and mathematical models to represent visual information.
CGR is crucial in many fields like gaming, simulations, visual effects, and
interface design.
Actual Methodology Followed
Topic Work Done Data Work Done By
1. Searching of topic (Snake Game) Sharayu Jadhav
2. Gathering of Information (Rationale, Aim, Applications, Prachi Jadhav
etc.)
3. Execution of Program 1. Download Turbo c/c++. Siddhi Jadhav
2. Install Turbo c/c++.
3. Run the program.
4. Get output.
4. Report Making Finalization of report Vaishnavi Jadhav
Resources Required
Sr. Name of Resources Specification Qty. Remark
No.
1. Computer Intel i3, 4GB RAM or above 1 -
2. MS-Word Office 2007 or above 1 -
3. Turbo c/c++ Version 3.0 or above 1 -
Source Code : -
#include< stdio.h>
#include < conio.h >
using namespace std;
bool gameover;
const int width = 20;
const int height = 17;
int x, y, fruitX, fruitY, score;
int tailX[100], tailY[100]; //snake coordinates
int nTail;
enum eDirecton {STOP = 0, LEFT,RIGHT, UP, DOWN}; // Controls
eDirecton dir;
void Setup() {
gameover = false;
dir = STOP;
x = width / 2;
y = height / 2;
fruitX = rand() % width; //display fruit in a random place
fruitY = rand() % height; score = 0;
void Draw() {
system("cls");
for(int i = 0; i < width+2; i++)
cout << "#";
cout << endl ;
for (int i = 0; i < height ; i++) {
for (int j = 0; j < width; j++) {
if (j == 0)
cout << "#"; //walls
if (i == y && j == x)
cout << "*"; // snake tale
else if (i == fruitY && j == fruitX )
cout << "%"; // change it to change the fruit
else {
bool print = false;
for (int k = 0; k< nTail ; k++) {
if (tailX [k] == j && tailY [k] == i) {
cout << "*"; print = true;
if (!print) cout << " ";
if (j == width -1)
cout << "#";
cout << endl;
for (int i = 0; i< width+2; i++)
cout << "#";
cout << endl;
cout << "Score:" << score << endl ;
void Input ()
{
if (_kbhit ()) {
switch (_getch ()) {
case 'a':
dir = LEFT;
break;
case 'd':
dir = RIGHT;
break;
case 'w':
dir = UP;
break;
case 's':
dir = DOWN ;
break;
case 'x':
gameover = true;
break;
void algorithm()
{
int prevX = tailX [0];
int prevY = tailY [0];
int prev2X, prev2Y;
tailX[0] = x;
tailY[0] = y;
for(int i = 1;i < nTail ; i++) {
prev2X = tailX[i];
prev2Y = tailY[i];
tailX[i] = prevX;
tailY[i] = prevY;
prevX = prev2X;
prevY = prev2Y ;
switch (dir) {
case LEFT:
x--;
break;
case RIGHT:
x++;
break;
case UP:
y--;
break;
case DOWN:
y++;
break;
default:
break;
if (x >= width) x =0;else if (x <0) x = width -1;
if (y >= height) y = 0; else if (y < 0) y = height - 1;
for (int i =0; i< nTail ;i++)
if (tailX[i] == x && tailY[i] == y)
gameover = true;
if (x == fruitX && y == fruitY) {
score +=10;
fruitX = rand() % width;
fruitY = rand() % height;
nTail ++;
int main()
{
Setup();
while (!gameover) {
Draw ();
Input ();
algorithm ();
{
Return();
}
OUTPUT: -