100% found this document useful (1 vote)
1K views10 pages

On The Game of Cricket

The document describes a virtual cricket game project implemented in C++. It includes classes for Player, Team and Game. The game allows two teams to be selected from a pool of 11 players and play two innings of 6 balls each. It tracks scores and outputs a match summary. Methodology details the steps to initialize teams and players, toss logic, tracking scores over deliveries and declaring a winner.

Uploaded by

Avneesh Agrahari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
1K views10 pages

On The Game of Cricket

The document describes a virtual cricket game project implemented in C++. It includes classes for Player, Team and Game. The game allows two teams to be selected from a pool of 11 players and play two innings of 6 balls each. It tracks scores and outputs a match summary. Methodology details the steps to initialize teams and players, toss logic, tracking scores over deliveries and declaring a winner.

Uploaded by

Avneesh Agrahari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Virtual Cricket Game

A Synopsis

Submitted

In Partial Fulfillment of the Requirements for


The Degree of

Bachelor of Technology
In
Computer Science & Engineering

Submitted by:
ADITYA YADAV
Under the Supervision of:

Ms. ANJALI AWASTHI

(Assistant Professor)

Department of Computer Science & Engineering


Faculty of Engineering

BABU BANARASI DAS INSTITUTE OF TECHNOLOGY &


MANAGEMENT-054, LUCKNOW, INDIA
Dec, 2021
CERTIFICATE

This is to certify that Mr. Aditya Yadav (Enroll. No. 2000540100014) has carried out the work
presented in the synopsis titled “Virtual Cricket Game” submitted for partial fulfillment for the
award of the Bachelor of Technology in Computer Science & Engineering from BBDITM,
Lucknow under my supervision.

It is also certified that:

(i) This synopsis embodies the original work of the candidate and has not been
earlier submitted elsewhere for the award of any degree/diploma/certificate.
(ii) The candidate has worked under my supervision for the prescribed period.
(iii) The synopsis fulfills the requirements of the norms and standards prescribed by
the AKTU and BBDITM, Lucknow, India.
(iv) No published work (figure, data, table etc.) has been reproduced in the synopsis
without express permission of the copyright owner(s).

Therefore, I deem this work fit and recommend for submission for the award of the aforesaid
degree.

Ms. Anjali Awasthi Prof. (Dr.) Diwakar Yagyasen


Synopsis Guide H.O.D.
(Assistant Professor) Department of CSE ,
Department of CSE, BBDITM, Lucknow
BBDITM, Lucknow

Date:13/11/2021
Place: Lucknow
DECLARATION

I hereby declare that the synopsis titled “Virtual Cricket Game” is an authentic record of the
research work carried out by me under the supervision of Ms. Anjali Awasthi, Department of
Computer Science & Engineering, for the period from September, 2021 to Nov, 2021 at
BBDITM, Lucknow. No part of this synopsis has been presented elsewhere for any other degree
or diploma earlier.

I declare that I have faithfully acknowledged and referred to the works of other researchers
wherever their published works have been cited in the synopsis. I further certify that I have not
willfully taken other's work, para, text, data, results, tables, figures etc. reported in the journals,
books, magazines, reports, synopsis, theses, etc., or available at web-sites without their
permission, and have not included those in this Bachelor of Technology synopsis citing as my
own work.

Date:13/11/2021

Signature

STUDENT NAME-: Aditya Yadav


ROLL NO-: 2000540100014
INTRODUCTION

Basically, I have built an “Virtual Cricket Game” implemented by using the C++ programming
language.

There should be two teams: Team A and Team B. Each team will have 4 players. The players for
each team will be selected by the user from the given pool of 11 players. You can assign the names
to those 11 players yourself.

The sequence in which the players are selected for each team will decide the batting and bowling
sequence for that team.
For example, if Team A has Virat, Rohit, Dhawan, and Rahul, Virat will be the first player to bat or
ball.

There should be two innings.


Each innings will be of 6 balls. In each innings, only one bowler from the bowling team will bowl
all the 6 deliveries and at a time one batsman from the batting team will bat until he is declared out.
The first player from the bowling team will be always selected to bowl first and the first player
from the batting team will be always selected to bat first.
When a batsman is OUT, the next batsman from the batting team in sequence will start batting.

There should be a toss functionality. The team who wins the toss will decide to either bat or bowl
first.
In each delivery, possible runs can be scored from 0 to 6.

OUT criteria: If a batsman scores 0 runs he will be declared OUT and the next batsman in
sequence will start batting.

Match End criteria


If runs scored by Team A is greater than the opponent
Team B, then Team A will win the game or vice-versa.
If runs scored by Team A and Team B are the same then the
match will draw.

Improve user experience by adding functions to display the pool of all the 11 players, display
players of each team after team selection, display game scorecard after each delivery and display
the match summary when the match ends.
METHODOLOGY/ PLANNING OF WORK

Methodology will include the steps to be followed to complete the project during the project
development.

1. Create three classes namely Player, Team, and Game.


a). Create 3 header files (.h) and the corresponding source files (.cpp) for the three classes.
b). Declare Player class attributes to store information such as name, unique id, runs scored, balls
played, balls bowled, runs given, and wickets taken in the match.
c). Declare Team class attributes to store information such as team name, total runs scored by the
team, total wickets lost, total balls bowled, and list of team players.
d). Declare Game class attributes to store information such as team A and team B details, players
per team, maximum deliveries allowed in each innings, names of all the 11 given players, and a
variable to check which innings is going on.
e). Additionally, in the Game class, declare two pointers of type class team to point to the batting
team and bowling team in each innings and two pointers of type class Player to point to the
current batsman and the bowler.

2. Welcome users and show a few basic game instructions.

3. Display all the 11 players with the array index so that the user can select the players using that
index for each team.
4. Select 4 players for each team one by one in an alternative way.
a). Write a utility function to take only integer user input.
b). Write a validation function to allow a player to be added to a team only once.

5. Display selected players from each team.

6. Add toss functionality.


a). Allow the toss winning team to choose either to bat or bowl first.
b). Initialize the batting team and the bowling team.

7. Start the first innings.


a). Initialize the batsman and the bowler.

8. Start playing the first innings.


a). After each delivery, update batsman score, bowler score, and both team’s score.
b). If in a delivery run scored is 0 then the batsman will be OUT and the next player in sequence
from the batting team will start batting.
c). If in a delivery run scored is 1 to 6, just update data and continue the innings.
d). After each delivery, validate the innings score to check if the innings.
9. After each delivery, show the game scorecard.
10. When the first innings ends, start the second innings.
a). Initialize the batting team and the bowling team.
b). Initialize the batsman and the bowler.

11. Start playing the second innings.


a). Reuse the same code written to play first innings.
b). After each delivery, validate both innings’ scores to decide the
winner.

12. Display match summary in the end.


Facilities required for proposed work

Hardware Required:

 Minimum
Ram: 4gb
Hard disk space: 2gb
 Recommended
Ram: 8gb
Hard disk space: 5gb
Software Required:

 Operating System: Windows, Linux, Mac etc.


 Programming Language: C++
 Required IDE- Eclipse, MinGW, JDK-13.02
Literature Survey

The game of Cricket is one which is followed and loved by a large proportion of the population
across the world. The liking goes to such an extent that people even end up having games of cricket
on their computers.

The impact of the Covid-19 pandemic has meant that many sports, including cricket, are on hiatus.
The interest in virtual cricket has picked up greatly over the past few months, and you can enjoy it
live from a variety of devices.
Virtual sports have taken precedence over outdoor games during the past few months. Throughout,
cricket fans regularly tuned into their devices to take a look at the virtual side of the game.

The game is developed using C++ programming language and many exciting concepts such as
random number generation phenomenon, file handling, and few concepts of cricket are mixed
proportionately to develop this game and make it interesting for its users and players. The random
numbers generated are cleverly assigned values to vary according to the inputs of the user, thus
making the game a very dynamic and filled with astonishment.
Some developers develop similar types of projects that is given below:
 In a website GeeksforGeeks developer develop a similar cricket game by using C/C++ but
in his project he/she do some changes in the project.
The basic idea of his project is that the task is to create a 2- player cricket game where
Player 1 is the user operating the program and Player 2 is the computer. In this game, the
following series of steps are followed:
i) First, the program will generate a random number between 0 and 25. That number
will be the score that Player 1 needs to make to win this match. Suppose the
program-generated random number is 15, then this number will be the score that
Player 1 needs to achieve.
ii) The second step is a real match between Player 1(User) and Player 2(Computer).
iii) The user will give input from numbers 1 to 6 using the keyboard. The system will
then again generate a random number between 1 and 6. If the input of the user
differs from the random number generated by the system, then it is a hit and the user
will get the score as the same number that was given as input by the user. If the two
numbers match, the user will be out and the final total score will be printed.
iv) The total score scored by the user is the sum of all the numbers entered by the user.
The score is calculated after each input by the user. Previous Input + Current Input
of the user.
Conclusion & Future Work

 This project “Virtual Cricket Game” is built by using C++ programming.


Basic functionality of this project is that we make two team - Team A and Team B and in
each team we select 4 player for both the team from the given pool of 11 player.
 After selection of 4-4 player in both teams. We do toss and then the team who won the toss
select
option between Batting or Balling.
 After selection of Batting or Balling. First inning starts one team do batting and another
team do balling.
 A batting team can bat maximum 6 ball and similar a balling team can ball maximum 6 ball.
Now First inning is over.

 After First inning is get over, second inning is start but now the balling team do batting and
the batting team do balling.
Now batting team has to score targeted run that is given by balling team.
And if the team is unable to achieve the targeted run that is given by balling team, then the
balling won the match, otherwise batting won the match.
Reference

Following are the reference which help me to made up this synopsis-

1.C++ Training Online | C Training Online | Internshala Trainings


2.[Link]
3.[Link]
for-beginners/
4.[Link]
5.[Link]
nt_game_in_Cricket_using_C
6.[Link]
7. [Link]
8. [Link]

You might also like