PROJECT ON
“Hand cricket using python”
PROJECT REPORT SUBMITTED FOR
PARTIAL FULFILMENT OF SUBJECT
INFORMATICS PRACTICES (065)
CLASS XII
UNDER THE GUIDANCE OF
Mrs. M. Roja
DONE BY:
C. K. MONISH
AKSHYCHARAN
STALIN
GANESHWER
KENDRIYA VIDYALAYA NO.1 TIRUPATI
1
TABLE OF CONTENTS
Page
[Link] Content
Number
1 Certificate 4
2 Acknowledgement 5
3 Problem Statement 6-7
4 Objective 8-9
5 Introduction 10-14
6 Hardware & software Requirement 15-16
7 Data Collection and Analysis Report 17-18
8 System Implementation 19-24
9 Output Screenshots 25-28
10 Conclusion 29-30
11 Bibliography 31-32
2
TABLE OF FIGURES
[Link] Figure Description Page
No. Number
1 Fig.1 Chose bat or ball and your bating 36
2 Fig.2 Computer bating 36
3 Fig.3 scores 37
3
CERTIFICATE
This is to certify that CK Monish, student of class XII B has successfully
completed the project " Hand cricket using python " under the guidance of Mrs.
M. Roja PGT CS, during the year 2023-24 in partial fulfillment of Informatics
Practices (Sub Code: 065) AISSCE Practical Examination.
Signature of Subject In-charge Signature of Principal
Submitted for the External Practical Examination held on _________
Internal Examiner External Examiner
4
ACKNOWLEDGEMENT
I would like to express my special thanks to our Principal Mrs. P. Anuradha as
well as our teacher [Link] PGT CS who gave me the golden opportunity
to do this wonderful project on the topic Hand cricket using python which also
helped me in doing a lot of research and I came to know about so many new
things.
Secondly I would also like to thank my parents and friends who helped me a lot
in finishing this project within the time limit. I am making this project not only
for marks but to also increase my knowledge.
5
CHAPTER- 1
Problem Statement
6
[Link] Statement:
Develop an application which has the following features:-
1) An application which is related to any one of the real time outdoor sports.
2) It should be a single user application.
3) People of any age group should be able to use the application easily.
4) The application must not have any graphic-related features.
5) The game doesn’t need to have any audio present.
6) The user must use the keyboard to run the application.
7) It should be compatible with the low end PCs.
8) An offline usable application.
7
CHAPTER- 2
Objective
8
[Link]:
To create a simple yet an amazing game to play. In your school days, we might
have played cricket.
Playing cricket is fun, but what if you don’t have the right equipment?
The idea is to create a cricket game that can be played indoors.
We intend to design a game commonly known as Hand cricket. The teenagers
are often found playing this interesting game. Before that, we will talk about
what is a hand cricket game?
What’s this project about?
This is a hybrid of cricket and the legacy hand cricket game. The game can be
played even without an internet connection.
Tournament mode is not yet included in this game. Customized tournaments can
be created using individual team files. For such tournaments, at least 256 MB of
disk space is recommended.
9
CHAPTER- 3
Introduction
10
[Link]:
Cricket is a game played by two teams of eleven players each on a pitch
with two sets of three stumps, which are called wickets. The bowler bowls the
ball down the pitch to the batsman of the opposing team, who must defend the
wickets in front of which he stands. The target of the game is to score as many
runs as possible.
Runs are scored by individual players by running on the playing strip
(called pitch) between the wickets, or by hitting a ball that flies outside the
boundary of the playground or which falls inside the boundary but bounces or
rolls outside. When the balls go directly outside the boundary, the batsman
scores six runs, and when the ball falls within the boundary but rolls outside
then the batsman scores four runs. The opponent team will bowl and field and
their objective is to take the wickets for each of the batsmen playing on the
pitch.
A batsman can be dismissed in one of several ways: by the bowler hitting
the wicket with the ball, which is called, bowled; by a fielder catching the
ball hit by the batsman before it touches the ground and it is called caught;
by the wicket-keeper or another
11
fielder breaking the stumps while the batsman attempts a run and is
therefore out of his ground. This is called stumped or run out. A batsman can
also be dismissed if the batsman breaks the wicket with his own bat or body and
this is called a hit wicket; by a part of the batsman’s body being hit by a ball
that would otherwise have hit the wicket is called leg before the wicket or
“lbw”.
A match consists of one or two innings, and each inning ends when the
tenth batsman of the batting team is out, when a certain number of overs (an
over: a series of six balls bowled) have been played or when the captain of the
batting team declares ending the innings voluntarily.
Forms of cricket range from Twenty20, with each team batting for a
single innings of 20 overs and the game generally lasting three hours, to Test
matches played over five days. Traditionally cricketers play in all-white kit, but
in limited overs cricket they wear club or team colors. In addition to the basic
kit, some players wear protective gear to prevent injury caused by the ball,
which is a hard, solid spheroid made of compressed leather with a slightly
raised sewn seam enclosing a cork core layered with tightly wound string.
The earliest reference to cricket is in South East England in the mid-16th
century. It spread globally with the expansion of the British Empire, with the
first international matches in the second half of the 19th century. The game's
governing body is the International Cricket Council (ICC), which has over 100
members, twelve of which are full members who play Test matches. The game's
rules, the Laws of Cricket, are maintained by Marylebone Cricket Club (MCC)
in London. The sport is followed primarily in South Asia, Australasia, the
United Kingdom, southern Africa and the West Indies.[1] Women's cricket,
which is organized and played separately, has also achieved international
standard. The most successful side playing international cricket is Australia,
12
which has won seven One Day International trophies, including five World
Cups, more than any other country and has been the top-rated Test side more
than any other country.
History:
During normal play, thirteen players and two umpires are on the field.
Two of the players are batters and the rest are all eleven members of the fielding
team. The other nine players in the batting team are off the field in the pavilion.
The image with overlay below shows what is happening when a ball is being
bowled and which of the personnel are on or close to the pitch.
Some players are skilled in both batting and bowling, or as either of these as
well as wicket-keeping, so are termed all-rounders. Bowlers are classified
according to their style, generally as fast bowlers, seam bowlers or spinners.
Batters are classified according to whether they are right-handed or left-handed.
Everyone can’t play it, as cricket being an outdoor game requires play
area, right equipment, and required number of players, which most can’t afford.
These make the people stop playing cricket. . This led to the creation of indoor
cricket, more commonly known as hand cricket. In this game, one plays the
role of batsman and the other bowler. They show numbers with their hands at
a time, if both the numbers are same then the batsman is declared out. If they
are different, the number played by the batsman is added to their score.
Odd or even also commonly known as Hand cricket is a simple game of chance
and a hand game, involving two people simultaneously revealing a number of
fingers and winning or losing depending on whether they are odd or even, or
alternatively involving one person picking up coins or other small objects and
hiding them in their closed hand, while another player guesses whether they
13
have an odd or even number. The game may be used to make a decision or
played for fun.
First of all you decide who bats or bowls first. we can decide that by
choosing odd or even(first both of you , you and your friend choose something
either odd or even , then put a number from 1-6 on both your hands at the same
time, then suppose the number you put and the number your friend put add up to
an even number, and if you've chosen even then you can choose whether you'll
bat or bowl and the same thing your friend if he/she wins).
After that if you're batting , both of you put a number(only from one to
ten) at the same and then if he/she didn't put the same number as you then the
number you put will add to the number of run you have scored. You keep going
on like this until finally your opponent puts the same number as you. After
he/she puts the same number as you then it's their turn to bat. They also do the
same thing until they finally become out. If their score is more than your score
then they win, if your score is more than his/her score then you win, but if it
comes to a draw then play the golden over. In this over both of you have one
over each in which you try to score as much as you can in that over and the
same for your opponent. You can also play defense by not putting any number
and just by closing your fist.
Playing this game is simple, fast, and convenient. Just enter the numbers
as fast or as slow as you wish, and the game would be played at your speed.
You no longer have to wait for your friends to put a number while they think!
The scoreboard provides all the information you need to succeed. A cricketer's
dream for real. Play with a lively experience and the touch of tapping a real
button.
14
CHAPTER- 4
Hardware & Software Requirement:
15
1. Hardware and software requirements
Programming language : Python(3.9 ,64-bit), MySQL
Operating system : Windows 10
Installed RAM : 4.00 GB (3.73 GB usable)
Graphics Card : None
Processor : Intel(R) Core(TM) i3-4010U CPU @ 1.70GHz 1.70 GHz
System type : 64-bit operating system, x64-based processor.
Pen and touch : Touch support with 10 touch points
Supported platforms:
Microsoft Windows 7 or later
Mac OS X 10.6 or later
Linux
NOTE: THIS GAME IS CROSS-PLATFORM COMPATIBLE.
16
CHAPTER- 5
Data Collection and Analysis Report
17
Technical Feasibility :-
Any operating system actually is compatible to mostly run this application,
contrary to popular belief. The users literally don’t have to worry about
anything else, which basically is fairly significant. It’s generally simple and
easy. He/she doesn’t require any high knowledge to specifically enjoy playing
this game. This is available for all types of systems including low end PCs.
Social :-
A user of any age/sex/caste can play this game if they have the basic
knowledge of using a system.
Economic:-
A user doesn’t have to be economically rich to be able to use the application. It
is available for free of cost for all.
Data we collected from
[Link]
18
CHAPTER- 6
System Implementation
19
import random
print(""" RULES
[Link] are given the chance to bat first and will be up
against the computer.
[Link] are not allowed to play a number above 10 and
below zero i.e., you can only play numbers between 0 and
10(0 and 10 included).
[Link] total score will be displayed after each ball.
[Link] the computer guesses your number, then you are
declared out!!
[Link] these rules apply for the computer also.
""")
lst1= [1,2,3,4,5,6,7,8,9,10]
chances_1= 20
no_of_chances_1= 0
your_runs= 0
20
print ("-----------------------------------------------\nYour
Batting\n")
while no_of_chances_1 < chances_1:
runs= int(input("Enter Runs for Your Batting Turn: "))
comp_bowl= [Link](lst1)
if runs==comp_bowl:
print ("Your Guess: ",runs,",Computer Guess:
",comp_bowl)
print ("You are Out. Your Total Runs= ",
your_runs,"\n")
break
elif runs>10:
print ("ALERT!! Support No only till 10\n")
continue
else:
your_runs= your_runs+runs
print ("Your Guess: ",runs,",Computer Guess:
",comp_bowl)
print ("Your runs Now are: ",your_runs,"\n")
21
no_of_chances_1= no_of_chances_1 + 1
lst2= [1,2,3,4,5,6,7,8,9,10]
chances_2= 20
no_of_chances_2= 0
comp_runs= 0
print ("-----------------------------------------------")
print ("Computer Batting-\n")
while no_of_chances_2 < chances_2:
bowl= int(input("Enter Runs for Your Bowling Turn:
"))
comp_bat= [Link](lst2)
if comp_bat==bowl:
print ("Computer Guess: ",comp_bat,"Your Guess:
",bowl)
print ("The Computer is Out. Computer Runs=
",comp_runs,"\n")
break
22
else:
comp_runs= comp_runs+comp_bat
print ("Computer Guess: ",comp_bat,"Your Guess:
",bowl)
print ("Computer Runs: ",comp_runs,"\n")
if comp_runs > your_runs:
break
no_of_chances_2= no_of_chances_2+1
print ("\n-----------------------------------------------\
nRESULTS: ")
if comp_runs < your_runs:
print ("\nYou won the Game.\n\nYour Total Runs=
",your_runs," [Bowls taken(Out of 20):
",no_of_chances_1+1,"]","\nComputer Total Runs=
",comp_runs," [Bowls Taken(Out of 20):
",no_of_chances_2+1,"]\n")
elif comp_runs == your_runs:
23
print ("The Game is a Tie")
else:
print ("\nComputer won the Game.\n\nComputer Total
Runs= ",comp_runs," [Bowls Taken(Out of 20):
",no_of_chances_2+1,"]","\nYour Total Runs=
",your_runs," [Bowls taken(Out of 20):
",no_of_chances_1+1,"]\n")
24
CHAPTER- 7
Output Screenshots
25
Output Screenshots
Fig.1: chose bat or ball and your bating
26
Fig.2: computer bating
27
Fig.3: scores and decleration of winning
28
CHAPTER- 8
Conclusion
29
Conclusion
Here, there are two players to play the hand cricket game. One is a player and
another one is a computer. We can edit the source code to play the hand cricket
game against a player rather than a computer.
Initially, we have to import random, and numbers from 0 to 10. Both
player and computer can play the game until get they get out. There is no limit
to the number of over like in real Cricket game as to increase the fun.
Later, we have to put the toss to decide whose are going to bat or bowl
first either a player or a computer. In this program, the player and computer will
have fair chance of winning the toss as we used the random function.
We can provide the chance to put the batting for a player or a computer to
score runs using a while loop. The ‘if’ condition will help to compare the guess
of both to check if it is equal or not. If it is equal then the batsman is out or else
it will add with the score using the else condition. Finally, if a player’s total
score is greater than a computer then it will print “Player won the match”. If
both total scores were equal then it will print “the match is a tie”. If it is vice
versa then it will print “the computer won the match” using the if…Elif…else
condition respectively after comparing both total scores.
30
CHAPTER- 9
Bibliography
31
Bibliography:
i. Informatics practices class XI ( By: NCERT )
ii. Informatics practices class XII ( By: NCERT )
iii. Informatics practices class XI ( By: SUMITA ARORA )
iv. Informatics practices class XII ( By: SUMITA ARORA )
v. Class Notes
vi. [Link]
32
33
34
35