Cgrmic

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

A

Micro Project Report


On

“Snake Game”

Submitted by
Rugved Tajane
Aditya Borse
Vishwajeet
Suryawanshi
Vaibhav Rathore

Under the Guidance of


Prof.R.C.Mahajan
In the Partial Fulfilment of Third Semester of Diploma in
Computer Engineering

Department of Computer Engineering


Sandip Polytechnic Mahiravani,
Nashik - 422213

Affiliated to

Maharashtra State
Board of Technical Education

Academic Year 2022-23


Maharashtra State
Board of Technical Education

Certificate
This is to certify that Mr .Rugved Vijay Tajane of Student with Roll No-28 has successfully completedMicro-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.

Place : Nashik Enrollment No:

Date: Exam Seat No:

Course Teacher Head of the Department Head of the Institute


Maharashtra State
Board of Technical Education

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.

Place : Nashik Enrollment No:

Date: Exam Seat No:

Course Teacher Head of the Department Head of the Institute


Maharashtra State
Board of Technical Education

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.

Place : Nashik Enrollment No:

Date: Exam Seat No:

Course Teacher Head of the Department Head of the Institute


Maharashtra State
Board of Technical Education

Certificate
This is to certify that Mr. Vaibhav Anil Rathore of Student with Roll No-44 has successfully completedMicro-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.

Place : Nashik Enrollment No:

Date: Exam Seat No:

Course Teacher Head of the Department Head of the Institute


Annexure – I

Micro Project Proposal


“Snake Game”

1.0 Aims/Benefits of the Micro-Project:


1 To learn programming in graphics.
2 To learn about data structure.
3 To learn about basic operation.
4 To learn about graphic algorithms.
5 To learn about other header file.
2.0 Course Outcomes Addressed:
1. Manipulate visual and geometric information of images .
2. Implement standard algorithms to draw various graphics objects using C program .
3.0 Proposed Methodology:
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.

4.0 Action Plan:

Sr. Planned Planned Name of Responsible Team


No Details of Activity Start Date Finish Date Members
1 Topic Discussion & Selection

2 Aim/Benefits & Importance

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

5.0 Resources Required:

SrNo Name of Resource/Material Specification Qty. Remarks


1 Hardware Resource Intel i3,2GB RAM 1 -
2 Software Resource Turbo C/C++ 1 -
3 Any Other Resource Internet 1 -

Name of Team Members with Roll No:

Roll No Name of Team Members

28. 1.Rugved Tajane

05. 2. Aditya Borse

48. 3.Vishwajeet Suryawanshi

44. 4.Vaibhav Rathore

Name & Signature of Course Teacher


(Prof.R.C.Mahajan)
Annexure – II

Micro Project Report


Rationale (Purpose of the project):
1) To improve the graphics skills.
2)To improve accuracy.
3) To learn programming.

Aims/Benefits of the Micro-Project:


1.To learn programming in graphics.
2.To learn about data structure.
3.To learn about basic operation.
4.To learn about graphic algorithms.
5.To learn about other header file.

Course Outcomes Achieved:


1. Manipulate visual and geometric information of images
2. Implement standard algorithms to draw various graphics objects using C program

3.0 Literature Review:

This project is inspired from websites like codewithC.com,studytonight.com We used the some new
header file to design the pendulum clock.

4.0Actual Methodology Followed:

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 two rectangles, one inside the other, using the rectangle() function to act as the outer
outlineof the clock & the other is the inner outline of the clock.
• Color the space between the two rectangles brown using setfillstyle() and floodfill() functions
• Implement a circle inside the inner rectangle using the circle() function
• Color all other parts leaving the circle with dark gray using setfillstyle() and floodfill() functions.
• In the circle, insert all the digits using settextstyle() and outtextxy() functions.
• Calculate the coordinates of the digits.
• Implement the pendulum with two lines by using the line() function & another circle by using
thecircle() function which will act as the bob.
• Color all of them black using the setfillstyle() and floodfill() functions again.
• Implement hour, minute & second hands by using the line() function.
• Color the objects individually by using the setcolor() function.

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>

int i, j, height = 20, width = 20;


int gameover, score;
int x, y, fruitx, fruity, flag;

// Function to generate the fruit


// within the boundary
void setup()
{
gameover = 0;

// Stores height and width


x = height / 2;
y = width / 2;
label1:
fruitx = rand() % 20;
if (fruitx == 0)
goto label1;
label2:
fruity = rand() % 20;
if (fruity == 0)
goto label2;
score = 0;
}

// Function to draw the boundaries


void draw()
{
system("cls");
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 {
if (i == x && j == y)
printf("0");
else if (i == fruitx
&& j == fruity)
printf("*");
else
printf(" ");
}
}
printf("\n");
}

// Print the score after the


// game ends
printf("score = %d", score);
printf("\n");
printf("press X to quit the game");
}

// Function to take the input


void input()
{
if (kbhit()) {
switch (getch()) {
case 'a':
flag = 1;
break;
case 's':
flag = 2;
break;
case 'd':
flag = 3;
break;
case 'w':
flag = 4;
break;
case 'x':
gameover = 1;
break;
}
}
}

// Function for the logic behind


// each movement
void logic()
{
sleep(0.01);
switch (flag) {
case 1:
y--;
break;
case 2:
x++;
break;
case 3:
y++;
break;
case 4:
x--;
break;
default:
break;
}

// If the game is over


if (x < 0 || x > height
|| y < 0 || y > width)
gameover = 1;

// If snake reaches the fruit


// then update the score
if (x == fruitx && y == fruity) {
label3:
fruitx = rand() % 20;
if (fruitx == 0)
goto label3;

// After eating the above fruit


// generate new fruit
label4:
fruity = rand() % 20;
if (fruity == 0)
goto label4;
score += 10;
}
}

// Driver Code
void main()
{
int m, n;

// Generate boundary
setup();

// Until the game is over


while (!gameover) {

// Function Call
draw();
input();
logic();
}
}
getch();
}
OUTPUT:

7.0 Skill Developed:

a) Practical Outcomes:
1. We can perform basic operation of graphic

2. 2. Wecan apply different polygon filling


algorithms.
3. We learn about new header files.

b) Unit Outcomes in Cognitive Domain:

1. Manipulate visual and geometric information of images


2. Implement standard algorithms to draw various graphics objects using C program
Outcomes in Affective Domain:

1. We Followed safe practices.


2. We Practiced energy conversation.

Application of this Micro-Project:


1) To improve the graphics skills.
2)To improve accuracy.
3) To learn programming.

Name & Signature of Course Teacher


(Prof.R.C.Mahajan)

You might also like