0% found this document useful (0 votes)
11 views36 pages

Mini Project Report 111sanke

sanke

Uploaded by

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

Mini Project Report 111sanke

sanke

Uploaded by

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

lOMoARcPSD|48990112

Mini Project Report 111

B tech (Galgotias University)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)
lOMoARcPSD|48990112

Mini Project Report


ON
SNAKE SWALLOW GAME
BY
Tushar Agrawal(Roll no. : 2000971520060)
Yuvraj Jaiswal (Roll no. : 2000971520066)
PrinceKumarSingh(Roll no. :2000971520037)
Sanskar Chhaparia(Roll no. : 2000971520049)
B.Tech(CSE-AI)
Mini Project Lab (KCS-354)
Session : 2021 - 2022
Under the Supervision
Of
Mr. Pramit Samant,
Assistant Professor, Department Of CSE - AI, GCET
Greater Noida

Department Of Computer Science & Engineering


Galgotias College Of Engineering & Technology
Greater Noida

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

GALGOTIAS COLLEGE OF ENGINEERING & TECHNOLOGY


GREATER NOIDA, UTTAR PRADESH, INDIA- 201306.

CERTIFICATE

This is to certify that the Mini-project report entitled


“Snake Swallow Game'' submitted by Mr.Tushar Agrawal
(2000971520060), Mr.Yuvraj Jaiswal (2000971520066), Mr.
Prince Kumar Singh (2000971520037), Mr.Sanskar
Chhaparia (2000971520049) to the Galgotias College of
Engineering & Technology, Greater Noida, Uttar Pradesh,
affiliated to Dr. A.P.J. Abdul Kalam Technical University
Lucknow, Uttar Pradesh in partial fulfillment for the award of
Degree of Bachelor of Technology in Computer science &
Engineering is a bonafide record of the project work carried out
by them under my supervision during the year 2021-2022.

Mr. Pramit Samant Dr. Vishnu Sharma


Assistant Professor Professor and Head
Deptt. of CSE Deptt. of CSE
Date : Date :

ACKNOWLEDGEMENT
Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)
lOMoARcPSD|48990112

We have taken efforts in this project. However, it would not have been
possible without the kind support and help of many individuals and
organizations. We would like to extend my sincere thanks to all of them.

We are highly indebted to Mr.Pramit Sammant for his guidance and constant
supervision. Also, we are highly thankful to them for providing necessary
information regarding the project & also for their support in completing the
project.

We are extremely indebted to Dr. Vishnu Sharma, HOD, Department of


Computer Science and Engineering, GCET and Pramit Sammant, Project
Coordinator, Department of Computer Science and Engineering, GCET for
their valuable suggestions and constant support throughout our project tenure.
We would also like to express our sincere thanks to all faculty and staff
members of the Department of Computer Science and Engineering, GCET for
their support in completing this project on time.

We also express gratitude towards our parents for their kind cooperation and
encouragement which helped me in completion of this project. Our thanks and
appreciation also go to our friends in developing the project and all the people
who have willingly helped me out with their abilities.

Tushar Agrawal,
Yuvraj Jaiswal,
Prince Kumar Singh,
Sanskar Chhaparia

ABSTRACT

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

The Nokia inspired Snake game was implemented on 8051 platform. The
game is built on the AT89551 Microcontroller. The game uses an 8 8 LED
dot matrix display and five way keys for user interface. A dedicated delay
settings key provides one touch access to the delay settings mode where
the speed of the Snake can be adjusted.

In our project we are implementing the snake game by using a


microcontroller. In this we are using switches one is Start for starting of the
game and remaining switches for snake movements left, right, up and
down these switches used like buttons in mobile. We are going to develop
coding by using python according to that coding by using dot matrix the
snake and fruits will be display on 8*8 dot-matrix and by using switches
the game will be operated according to our requirement.

Tushar Agrawal

Sanskar Chhaparia

Yuvraj Jaiswal

Prince Kumar Singh

Table of Contents

Title Page
CERTIFICATE 1
ACKNOWLEDGEMENT 2
Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)
lOMoARcPSD|48990112

ABSTRACT 3
TABLE OF CONTENTS 4
LIST OF TABLES 5
LIST OF FIGURES 6

CHAPTER 1: INTRODUCTION 8

1 Introduction to the Project

CHAPTER 2: LITERATURE REVIEW 9


2.1 Literature Survey
2.2 Modules
CHAPTER 3: PROBLEM FORMULATION 11
3.1 Description of Problem Domain
3.2 Problem Statement
3.3 Depiction of Problem Statement
3.4 Objective

CHAPTER 4: PROPOSED WORK AND SYSTEM DESIGN 16


4.1 Software Design
4.2 Functional Requirements
4.3 Non – Functional Requirements

4.4 Software Requirement Specification 19


4.4.1 Problem/Requirement Analysis
4.4.2 Requirement Specification
4.4.3 Role Of SRS
4.4.4 Scope

4.5 Hardware And Software Requirements 20


4.5.1 Software Requirements
4.5.2 Hardware Requirements

CHAPTER 5: IMPLEMENTATION 21
5.1 Python
5.2 PY-GAME
5.3 Functional Description

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

5.4 Implementation Steps


5.5 Working Algorithm

CHAPTER 6: RESULT AND DEMONSTRATION 27

6.1 Software Testing


6.1.1Testing Objectives
6.2. Test Case Design 28
6.2.1 White Box Testing
6.2.2 Black box Testing
6.2.3 Unit testing
6.2.4 Integration Testing
6.2.5 Validation Testing
6.2.6 System Testing
6.3 TEST CASES

CHAPTER 7: CONTRIBUTION OF PROJECT TO THE SOCIETY 33

CHAPTER 8: CONCLUSION, LIMITATION AND FUTURE SCOPE 34

REFERENCES 35

List of Tables

Title Page

Table 5.1: Python Version 22

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

Table 5. Function Description 25

List Of Figures

Title Page

Fig 3.1.1 : Representation of Snake And Apple 11

Fig 3.1.2 : Snake Stuck Against The Wall 12

Fig 6.3 : In – Game ScreenShots 33

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

Chapter 1: INTRODUCTION

Playing games is fun and exciting. It gives us relief from stress and unwinds
from our stressful work. Many of us spend our free time or others that use most
of their time in playing and exploring new games. Today, with the raped
development of technology we have, games that are rising up together with it.
Nowadays with technology we have many games that are developed for
computers specifically for windows. With the high technology equipped with
these computer games become robust and attract many people to buy or have
this gadget for them to experience what's inside it which makes it a trend for the
new generation of gadget.
Snake game is a computer action game, whose goal is to control a stake to move
and collect food in a map. It has been around since the earliest days of home
computing and has re-emerged in recent years on mobile phones.
It isn't the world's greatest game, but it does give you an idea of what you can
achieve with a simple python program, and perhaps the basis by which to
extend the principles and create more interesting games on your own. To move
the snake, use up arrow for up, down arrow for down, "left arrow for left and
right arrow for right. Press "Q' to exit the game at any time, press "C" to
continue the game.
The aim of the game is to collect the dots (food) and avoid the obstacles (walls,
boundaries). As you collect the food, the stake gets longer. The score also
increases. There is no concept of life. Once you hit an obstacle, that's it, game
over.

Chapter 2: LITERATURE REVIEW

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

2.1 LITERATURE SURVEY

The history of the Snake game goes back to the 1970's, the concept originated in
the 1976 arcade game Blockade, and its simplicity has led to many
implementations. However, it was the 1990's when the game took on the look
that we will be using. It was sold under numerous names and many platforms
but probably gained widespread recognition when it was shipped as standard on
Nokia mobile phones in the late 1990' The first published Nokia, for
monochrome phones. It was programmed in 1997 by Taneli Armanto of Nokia
and introduced on the Nokia 6110,

The game involves controlling a single block or snakehead by turning only left
or right by ninety degrees until you manage to cut a block. When you get the
block, the Snake grows an extra block or body segment.

If, or rather when, the snake bumps into the edge of the screen or accidentally
casts himself the game is over. The more blocks the snake eats the higher the
score.

2.2 MODULES

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

PyGame
Py game is a cross-platform set of python modules designed for
writing video games.
It includes computer graphics and sound libraries designed to be used
with the Python Programming language.
• To install the library, you can use pip installer from the command
line:
pip install pygame
import pygame

Python time module


Python has a module named time to handle time-related tasks. To use
functions defined in the module, we need to import the module first.
Here's how:
import time

Python random module


Python has a built-in module that you can use to make random
numbers
import random

Chapter 3 : PROBLEM FORMULATION

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

3.1 DESCRIPTION OF PROBLEM DOMAIN

The core focus of our project was to determine which algorithms


would be more effective in a hard real-time environment. The domain
in this case is the Snake Game, which will, in turn, attempt to identify
an, or even the, algorithm that can not only play the game but
compete with human players. The Snake Game is a classic arcade
style game where it is a single-player game but the focus is to achieve
the highest score possible thus competing with yourself and others.

Fig 3.1.1 : Red Circle Is Apple And Green Rectangle Is Snake

To play the game one controls a snake by selecting one of the cardinal
directions that the snake will move in. In order to score points you
must direct the snake to an apple, there is only one apple in the game
at time. The snake then eats the apple and increases in length by one

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

square or unit. The game ends when the snake runs into either the
boundaries of the play area or itself, the trailing snake body. The
domain provides a very interesting problem given that the snake
always moves after a given timing delay and the snake continually
grows in size. The delay is the feature that really makes the game
difficult because if you do not react fast enough the snake will
continue moving in the last direction given. This causes the player to
try to act as quickly as possible before the snake runs into an obstacle.
Also because the snake is constantly trailed by its tail(being the main
obstacle) any move taken cannot be undone or immediately back
tracked. So if you were to make a wrong turn into a dead end there is
no way to reverse that move to back out of the loop.

Fig 3.1.2 : In This Figure, Snake Was Moving Towards Apple


But Got Stuck Against The Wall Instead

Although with every move your tail moves thus creating a situation
where a dead end or closed loop will no longer be a dead end after x
moves. The apple also can be very tricky since you cannot know
where the next apple position will be and this makes it difficult to go
straight for the current apple without thinking of how to get into a
good position for the next apple.

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

3.2 PROBLEM STATEMENT


The problem is to design a Snake Game which provides the following
functionalities :
1. Snakes can move in a given direction and when they eat the
food, the length of the snake increases.
2. When the snake crosses itself, the game will be over.

3. Food will be generated at a given interval.

The main classes that can be used are :


1. Snake
2. Cell
3. Board
4. Game

3.3 PROBLEM DEPICTION

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

3.4 OBJECTIVE
Snake game is one of the most popular arcade games of all time.
In this game, the main objective of the player is to catch the
maximum number of fruits without hitting the wall or itself.
Creating a snake game can be taken as a challenge while learning
Python or Pygame. It is one of the best beginner – friendly projects
that every novice programmer should take as a challenge.
Learning to build a video game is kinda interesting and fun learning.

Chapter 4: SYSTEM DESIGN

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

To create a Snake game that allows users to control the movement of


a snake on a screen, to get points for eating food and avoiding running
into the walls or the growing tail of the snake itself. In this problem,
we want to write a game where a graphical representation of a snake
moves across the screen. When it encounters a piece of food, the
snake grows longer and we gain a point. If it hits the wall we die.
To write this program we are going to need:
1. A way of representing the sake of representing the food.
2. A way to display the score,
3. A way for our instructions to reach the snake
4. A way to know when we've run into something and died
Our system is going to involve working with both hardware and
software, and so we will need to understand what we have available in
hardware that can assist us.
If we build our software so that the snake is controlled by directional
arrows on the keyboard. Now that understand how our hardware will
work in the design of our system, let's move on to starting the design
of our software system

4.1 SOFTWARE DESIGN

• We are going to use an object-oriented approach and provide some


detail here. We have to think about the Classes that we want to build,
with the associated variables and functions that will make sense for
the development.
Let's start by looking at the snake itself, the hero of the game. The
stake has a location on the screen, and contains multiple visual
elements, as it can grow, and the snake's head is connected to the rest

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

of the snake and the stake's body follows it around the screen. If the
snake "eats" food, it grows. The snake moves in a very precise way.
Based on what the user types, the snake will move in a given
direction. Every time the snake moves, the head will go in the new
direction, and every piece of the snake will move up, by occupying
the space that was formerly occupied by the piece in front of it.
• To grow in size, the snake has to eat food. How can we show the
snake eating? The simplest answer is that if the head of the snake and
the food are in the same place, we consider that the snake eats the
food. This means that we have to know where the food is. When it's
eaten, it disappears, the snake grows, and the food shows up
somewhere else. But we also wanted to show a score, so we need a
variable to keep track of that as well. In this case, we'll create a
Scoreboard class where we can increase the counter value and display
it.

4.2 FUNCTIONAL REQUIREMENTS


Here are the requirements (functional requirements for how the snake
moves.
1. The snake must appear to move around the screen
2. The snake must turn in response to user input
3. The snake will increase in length if it eats food
4. The snake will die if it runs to the walls
5. The snake never stops moving

4.3 NON-FUNCTIONAL REQUIREMENTS

The primary features of IT projects involve implementing like an


application, a piece of infrastructure, a patch

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

In this specific context functional requirements tells us about what


project does when interacted, whereas non-functional requirements
describe about the bounds of performance should be:

I.Robustness:
Robustness is nothing but its ability to tolerate the effects of the
system's fictional body. And it can also be defined by its system’s
ability that it can withstand change without transforming its initial
stable configuration.
II.Reliability:
The system is trustworthy and it is consistently good in performance.
It can also be stated as the system performs the function without any
failure under certain conditions and specified period of time.
III.Availability:
The system is available 247, Availability and Reliability are directly
proportional as reliability increases availability also increases. The ser
can have access to the system all the time
IV.Reusability:
The system can be used any number of times by the specific user. And
the reusability is consistent, adaptable and stable
V.Effectiveness:
The algorithm is capable of producing desired results or it has the
ability to provide better results.
4.4 SOFTWARE REQUIREMENT SPECIFICATION

4.4.1 SRS
Software Requirement Specification (SRS) is the starting point of the software
developing activity. As the system grew more complex it became evident that
the goal of the entire system cannot be easily comprehended. Hence the need for

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

the requirement phase arose. The software project is initiated by the client. The
SRS is the means of translating the ideas of the minds of clients (the input) into
a formal document (the output of the requirement phase) The SRS phase
consists of the activities.

4.4.2 Problem/Requirement Analysis.


The process is order and more nebulous of the two, deals with understanding the
problem, the constraints.

4.4.3.Requirement Specification
Here, the focus is on specifying what has been found giving analysis such as
representation ,specification languages and tools, and checking the
specifications are addressed during this
The Requirement phase terminates with the production of the validate SS
document. Producing the SRS document is the basic goal of this phase.

4.4.4. Role of SRS


The purpose of the Software Requirement Specification is to reduce the
communication gap between the clients and developers. Software Requirement
Specification is the medium which makes sure which the client and user needs
are accurately specified. It forms the basis of software development.
A good SRS should satisfy all the parties involved in the system.
The SRS document is the basic goal of this phase. The purpose of the Software
Requirement Specification is to reduce the communication gap between the
clients and the developers.
The developer is responsible for asking for clarifications, where necessary, and
will not make alterations without the permission of the client.

4.5 HARDWARE AND SOFTWARE REQUIREMENTS

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

4.5.1 Software Requirements

The development and deployment of the application requires the following


general and specific minimum requirements for software:
• Programming Language Translaties-Python 18
IDE-Jupyter Notebook Operating System used Windows 10.

4.5.2 Hardware Requirements

The development and deployment of the application requires the following


general and specific minimum requirements for hardware:
Processor-(32-bit or 64-bit) RAM (4 GB).

CHAPTER 5: IMPLEMENTATION

5.1 PYTHON

Python is an object-oriented, high level language, interpreted,


dynamic and multipurpose programming language.
Python is easy to leam yet powerful and versatile scripting language
which makes it attractive for Application Development

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

Python's syntax and dynamic typing with its interpreted nature, make
it an ideal language for scripting and rapid application development in
many areas
Python supports multiple programming patterns, including object
oriented programming, imperative and functional programming or
procedural styles Python is not intended to work on special areas such
as web programming. That is why it is known as multipurpose
because it can be used with web, enterprise, 3D CAD ere We don't
need to use data types to declare variables because it is dynamically
typed so we can write a=10 to declare an integer value in a variable.
Python makes the development and debugging fast because there is
no compilation step included in python development and the edit-test-
debug cycle is very fast.

Python History
Python laid its foundation in the late 1980s. . The implementation of
Python was started in December 1989 by Guido Van Rossum CWI in
the Netherlands.
ABC programming language is said to be the predecessor of Python
language which was capable of Exception Handling and interfacing
with Amoeba Operating System.
Python is influenced by programming languages like
ABC language
Modula-3

Python Versions
Python programming language is being updated regularly with new
features and support. There are a lot of updates in python versions,
from 1994 to the current date.
A list of python versions with its date is given below.

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

Python Version Release Date

Python 1.0 January 1994


Python 1.5 December 31, 1997
Python 1.6 September 5, 2000
Python 2.0 October 16, 2000
Python 2.1 April 17, 2001
Python 2.2 December 21, 2001
Python 2.3 July 29, 2005
Python 2.4 November 30, 2014
Python 2.5 September 19, 2006
Python 2.6 October 1, 2008
Python 2.7 July 3, 2010
Python 3.0 December 3, 2008
Python 3.1 June 27, 2009
Python 3.2 February 20, 2011
Python 3.3 September 29, 2012

5.2 PY-GAME

Python is the most popular programming language or nothing wrong


to say that it is the next generation programming language.
In every emerging field in computer science, Python makes its
presence actively Python has vast libraries for various fields such as
Machine Learning (Numpy, Pandas, Matplotih), Artificial intelligence

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

(Pytorch, TensorFlow), and Game development


Game programming is very rewarding nowadays and it can also be
used in advertising and as a teaching tool too. Game development
includes mathematics, logic, physics, AL, and much more and it can
be amazingly fine. In python, game programming is done in pygame
and it is one of the best modules for doing so
Pygame is a cross-platform set of Python modules which is used to
create video games. It consists of computer graphics and sound
libraries designed to be used with the Python
programming language. Pygame was officially written by Pete
Shinners to replace PySDL. Pygame is suitable to create client-side
applications that can be potentially wrapped in a standalone
executable.

Installing pygame:

The first thing you will need to do in order to create games using
Pygame is to install it on your systems. To do that, you can simply use
the following command:
pip install pygame

5.3FUNCTION DESCRIPTION

Once that is done, just import Pygame and start our game
development. Before moving on, take a look at the Pygame functions
that have been used in this Snake Game along with their descriptions.

Function Description

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

init() Initializes all of the imported Pygame modules


( returns a tuple indicating success and failure
of initializations)

display.set_model() Takes a tuple or a list us ats parameter to create


a surface (tuple preferred)

update() Updates the screen

quin() Used to un-initialize everything

set caption() Will set the caption test on the top of the display
screen.

event.get() Returns list of all events

Surface fill() Will fill the surface with a solid color

time Clock() Helps truck time

font SysFont() Will create a Pygame font from the System font
resources.

5.4 IMPLEMENTATION STEPS

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

1. Installing pygame

2. Create the screen

3. Create the Snake

4. Moving the Snake

5. Game over when snake hits the boundaries

6. Adding the Food

7. Increasing the length of the snake & Displaying the score

5.5 WORKING ALGORITHM

Let's look at how a program to run the whole game might look.

1. Draw the playing area with bounding rectangle, set the counter to
zero and display I

2. Draw the snake in a starting position,

3. Draw the food in a starting location.

4. On user input, change snake direction.

5. Move the snake one move

6. If the snake is over food, eat it, increase the score, grow, move the
food.

7. else if the snake is over in a wall, die.

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

8. Go back to step 4

9. Until the snake die

CHAPTER 6: TESTING

6.1 SOFTWARE TESTING

Software testing is a critical element of software quality assurance and


represents the ultimate review of specification, design and code
generation

6.1.1 Testing Objectives

• To ensure that during operation the system will perform as per


specification. TO make sure that system meets the user requirements
during operation
• To make sure that during the operation, incorrect input, processing
and output will be detected • To see that when correct inputs are fed to
the system the outputs are correct
To verily that the controls incorporated in the same system as
intended • Testing is a process of executing a program with the intent
of finding an error

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

• A good test case is one that has a high probability of finding an as


yet undiscovered

The software developed has been tested successfully using the


following testing strategies and any errors that are encountered are
corrected and again the part of the program or the procedure of
function is put to testing until all the errors are removed. A successful
test is one that uncovers an as yet undiscovered error.

Note that the result of the system testing will prove that the system is
working correctly, It will give confidence to system designer, users of
the system.

6.2 TEST CASE DESIGN


6.2.1 White Box Testing
White box testing is a testing case design method that uses the control
structure of the procedure design to derive test cases. All independent
paths in a module are exercised at least once. l logical decisions are
exercised at once, execute all loops at boundaries and within their
operational bounds exercise internal data structure to ensure their
validity. Here the customer is given three chances to enter a valid
choice out of the given menu. After which the control exits the current
menu.
6.2.2 Black Box Testing
Black Box Testing attempts to find errors in following areas or
categories, incorrect or missing. functions interface error, errors in
data structures, performance error and initialization and termination
error. Here all the input data must match the data type to become a
valid entry.
6.2.3 Unit Testing:

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

Unit testing is essentially for the verification of the code produced


during the coding phase and the goal is to test the internal logic of the
module program. In the Genetic code project, the unit testing is done
during the coding phase of data entry forms whether the functions are
working properly or not. In this phase all the drivers are tested
whether they are rightly connected or not.

6.2.4 Integration Testing:


All the tested modules are combined into sub systems, which are then
tested. The goal is to see if the modules are properly integrated, and
the emphasis being on the testing interfaces between the modules. In
the genetic code integration testing is done mainly on table creation
modules and insertion modules.
6.2.5 Validation Testing :
This testing concentrates on confirming that the software is error-free
in all respects. All the specified validations are verified and the
software is subjected to hard core testing. It also aims at determining
the degree of deviation that exists in the software designed from the
specification, they are listed out and are corrected
6.2.6 System Testing :
This testing is a series of different tests whose primary is to fully
exercise the computer-based system. This involves :
Implementing the system in a simulated production environment and
testing it.
Introducing errors and testing for error handling.

6.3 TEST CASES

How can we test a full Snake game and, assuming it passes that stage,

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

how can we playtest that? The functional requirements that we


developed turn, almost immediately.
To display the snake, the first thing we want to do is to make sure that
we can draw the snake and move it around on the screen. So our
testing for correct function will be
1. Can I display the snake's head on the screen?
2. Will it move around as I want it to using keyboard control?
3. Is it displaying correctly?
4. Is the body moving correctly?
5. If we identify an error in the snake, because it's a Class, we will go
into the Snake class and fix it there. However, because we've
written the Food and Scoreboard as separate classes, whatever we
do in the Snake class shouldn't break anything in there, unless we
accidentally change the code without noticing. The next step for
the snake will be checking what happens when the head is detected
as colliding with something. Does it grow when it eats cat food?
Does it die when it hits a wall or itself! We'd then continue to test
the program until we've tested all of the individual elements and
their interactions together.

6. One useful test case is to see if everything is being drawn where


you expect. Because we aren't.
7. Using all the screen, it's possible to draw the food or the snake so
that it overlaps the black rectangle that's the boundary. Has the
programmer put the correct limits on the ranges where the snake
and the food can appear?
8. Testing the non-functional requirements often falls into the realm
of playability.

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

9. Many snake games increase the speed of the snake as it gets longer,
increasing the difficulty even further. This increased movement
speed gives a sense of urgency and can be a way to engage players
with the snake. But make it too fast and it becomes unplayable.

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

Fig : 6.3 IN GAME SCREENSHOTS

CHAPTER 7 : CONTRIBUTION OF
THE PROJECT TO THE SOCIETY

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

● Snake is a classic game that requires players to assess their surroundings


and find the quickest or safest route to a point. This is an excellent
opportunity to learn about spatial awareness and plan ahead to your next
move.
● The classic game is infamous for using your own success against you
when you become so long that you get in your own way. Whilst many
games and activities can teach your child about vital life skills, there are
not many that would educate on long term strategic planning.
● As many parents will know, it can be extremely frustrating to reach such
a high level and then lose as you crash into your own tail. The game
requires patience in order to grow and a cool head once you inevitably
lose. These are all valuable skills to learn early on in a child’s life that
will benefit them in later years.
● Snake is a tool that can be used as an educational helping hand. One of
the important parts of learning is that you will never get something right
the first time. Snake teaches children that practice makes perfect when it
comes to learning new skills.

CHAPTER 8 : CONCLUSIONS

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

The project in python programming 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 coordinates of the screen for the
snake to eat. Every time the snake eats the food. its length will be
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 relatively simple python programming, and perhaps the basis
by which to extend the principles and create more interesting
games on your own.

LIMITATIONS :

● The existing system only provides a text-based interface, which is


not as user-friendly as Graphical user Interface.

● Since the system is implemented in Manual, the response is very


slow.

● The transactions are executed in off-line mode, hence on-line data


capture and modification is not possible.

FUTURE SCOPE:

In this project, I have used a simple application. This project will


be able to be implemented in future after making some changes and

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)


lOMoARcPSD|48990112

modifications as I made this project at a low level. The


modifications that can be done in this 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://www.edureka.co/blog/snake-game-with-pygame/
https://pypi.org/project/pygame/
https://www.edueba.com/python-pygame/
https://www.w3schools.com/python/module_random.asp
https://www.programmiz.com/python-programming/time

Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy