Cgrmic
Cgrmic
“Snake Game”
Submitte
d by Rugved
Tajane
Aditya Borse
Vishwajeet
Suryawanshi
Vaibhav Rathore
Department of Computer
Engineering Sandip Polytechnic
Mahiravani,
Nashik - 422213
Affiliated to
Maharashtra State
Board of Technical Education
Certificate
This is to certify that Mr .Rugved Vijay Tajane of Student with Roll No-28 has successfully completed Micro-
project in course computer Graphics(22318) for the academic year 2022-23 as prescribed in the 'Assessment
Manual' during his/her tenure of completing Third Semester of Diploma Program in Computer Engineering from
institute, Sandip Polytechnic with institute code 1167.
Certificate
This is to certify that Mr Aditya Sharad Borse of Student with Roll No-05 has successfully completed Micro-
project in course computer Graphics(22318) for the academic year 2022-23 as prescribed in the 'Assessment
Manual' during his/her tenure of completing Third Semester of Diploma Program in Computer Engineering from
institute, Sandip Polytechnic with institute code 1167.
Certificate
This is to certify that Mr .Vishwajeet Nitin Suryawanshi of Student with Roll No-48 has successfully completed
Microproject in course computer Graphics(22318) for the academic year 2022-23 as prescribed in the
'Assessment Manual' during his/her tenure of completing Third Semester of Diploma Program in Computer
Engineering from institute, Sandip Polytechnic with institute code 1167.
Certificate
This is to certify that Mr. Vaibhav Anil Rathore of Student with Roll No-44 has successfully completed Micro-
project in course computer Graphics(22318) for the academic year 2022-23 as prescribed in the 'Assessment
Manual' during his/her tenure of completing Third Semester of Diploma Program in Computer Engineering from
institute, Sandip Polytechnic with institute code 1167.
3 Resources Required
1. Rugved Tajane
4 Analysis of Collected Data 2. Aditya Borse
5 Design & Editing of data 3. Vishwajeet Suryawanshi
4. Vaibhav Rathore
6 Compilation of Report
7 Compilation of Presentation
8 Presentation of Seminar
9 Final Submission
This project is inspired from websites like code with C.com,studytonight.com We used the some
new header file to design the pendulum clock.
First we formed our group then discussed over the topic. After doing research we finalized our topic
Snake game.Then we distributed our work among four of us. Rugved worked on the program of the
project, Vishwajeet worked on interface of the system, Aditya analyzed and solved the errors and
Vaibhav finalized design and flow of implementation.Similarly we created our report
Algorithm:
• Create a game board with a width and height of 20.
• Create a snake with a length of 3 and a head position of (10, 10).
• Create a fruit with a random position on the game board.
• Get user input for the direction of the snake's movement.
• Move the snake in the direction of the user input.
• Check if the snake has eaten the fruit. If it has, increase the snake's length and create a new fruit.
• Check if the snake has hit the wall or its own tail. If it has, end the game.
• Repeat steps 4-7 until the game ends.
5.0Actual Resources Used:
Sr
Name of Resource/Material Specification Qty. Remarks
No
1 Hardware Resource Intel i3,2GB RAM 1 -
2 Software Resource Turbo C/C++ 1 -
3 Any Other Resource Internet 1 -
6.0 CODE:
// C program to build the complete
// snake game
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
label2:
fruity = rand() % 20;
if (fruity == 0)
goto label2;
score = 0;
}
printf("#");
}
else {
if (i == x && j == y)
printf("0");
else if (i == fruitx
&& j == fruity)
printf("*");
else
printf(" ");
}
}
printf("\n");
}
case 's':
flag = 2;
break;
case 'd':
flag = 3;
break;
case 'w':
flag = 4;
break;
case 'x':
gameover = 1;
break;
}
}
}
// Driver Code
void main()
{
int m, n;
// Generate boundary
setup();
// Function Call
draw();
input();
logic();
}
}
getch();
}
OUTPUT:
a) Practical Outcomes:
1. We can perform basic operation of graphic
2. 2. We can apply different polygon filling
algorithms.
3. We learn about new header files.