DICE CRICKET

20
OPERATING SYSTEMS PROJECT ON DICE CRICKET Submitted to : Prof Persis Urbana Ivy DONE BY: SONERI DESHPANDE(10BIT0073) DISHTI MALHOTRA(10BIT0132) SAMRIDHI(1OBIT0217)

Transcript of DICE CRICKET

Page 1: DICE CRICKET

OPERATING SYSTEMS PROJECT ON

DICE CRICKET

Submitted to : Prof Persis Urbana Ivy

DONE BY:

SONERI DESHPANDE(10BIT0073)

DISHTI MALHOTRA(10BIT0132)

SAMRIDHI(1OBIT0217)

Page 2: DICE CRICKET

Playing Cricket using Dice—

Dice CricketSoneri Deshpande, Dishti Malhotra, Samridhi

SITE, VIT-Vellore

[email protected]

Abstract

Cricket is a very popular game in India. In every nook and corner of our country, from kids to elderly; all take keen interest in Cricket. The game has become the spirit of our country. Also , dice games are an old friend of ours. People have been playing Ludo since past many years. Hence the concept of the two games has been combined to produce a new game in which play Cricket using dice. The Dice is rolled to move through the path, the number on the dice decides the number of steps to be taken. The mouse stops at the point and whatever is the run or the letter(which signifies the dismissal of the player from the game)that is counted as runs or wickets. The game is easy to understand and play. And its interactive environment helps a novice player.

KeyWords: Cricket rules, dice roll

I. Introduction

Dice Cricket has been developed using the rules of Cricket and the basics of rolling a dice. It is an easy game which gives even the novice a chance to feel like a century batsman. The concept comes from the Pocket Cricket designed by Hamish Streling and Paul McLellan. In the pocket Cricket, there are 6 dice; 3 for the bowling team and 3 for the batting team. The game is played in teams with each team being allotted 3 dice. In our version of Dice Cricket, we have a platform where an individual player plays the game and the computer responds. The game begins by pressing the start button which

Page 3: DICE CRICKET

makes all; the score, the runs, the number of balls and the overs zero. Then the computer instructs to roll the dice to begin the game. As we roll the dice, we get a number on the top of the dice and we have to enter that number. Then following the arrow mark, we move on the buttons. We number which comes on the dice,that many buttons we cross and stop on the last. If it’s a red button the player loses a wicket. And if its blue the player scores. If the wickets become five the game terminates. Overs are calculates using the number of balls. The game is restricted on the number of wickets and not on the number of overs played.

These are the rules of cricket on which the game is based.

Scoring and winning

The laws then move on to discuss how runs can be scored and how one team can beat the other.

Law 18: Scoring runs. Runs are scored when the two batsmen run to each other's end of the pitch. Several runs can be scored from one ball.

Law 19: Boundaries. A boundary is marked round the edge of the field of play. If the ball is hit into or past this boundary, four runs are scored, or six

runs if the ball didn't hit the ground before crossing the boundary.

Law 20: Lost ball. If a ball in play is lost or cannot be recovered, the fielding side can call "lost ball". The batting side keeps any penalty runs (such as no-balls and wides) and scores the higher of six runs and the number of runs actually run.

Law 21: The result. The side which scores the most runs wins the match. If both sides score the same number of runs, the match is tied. However, the match may run out of time before the innings have all been completed. In this case, the match is drawn.

Law 22: The over. An over consists of six balls bowled, excluding wides and no balls. Consecutive overs are delivered from opposite ends of the pitch. A bowler may not bowl two consecutive overs.

Law 23: Dead ball. The ball comes into play when the bowler begins his run up, and becomes dead when all the action from that ball is over. Once the ball is dead, no runs can be scored and no batsmen can be dismissed. The ball becomes dead for a number of reasons, most commonly when a batsman is dismissed, when a boundary is hit, or when the ball has finally settled with the bowler or wicketkeeper.

Page 4: DICE CRICKET

Law 24: No ball. A ball can be a no ball for several reasons: if the bowler bowls from the wrong place; or if he straightens his elbow during the delivery; or if the bowling is dangerous; or if the ball bounces more than twice or rolls along the ground before reaching the batsman; or if the fielders are standing in illegal places. A no ball adds one run to the batting team's score, in addition to any other runs which are scored off it, and the batsman can't be dismissed off a no ball except by being run out, or by handling the ball, hitting the ball twice, or obstructing the field.

Law 25: Wide ball. An umpire calls a ball "wide" if, in his or her opinion, the batsman did not have a reasonable opportunity to score off the ball. A ball is called wide when the bowler bowls a bouncer that goes over the head of the batsman. A wide adds one run to the batting team's score, in addition to any other runs which are scored off it, and the batsman can't be dismissed off a wide except by being run out or stumped, or by handling the ball, hitting his wicket, or obstructing the field.

Law 26: Bye and Leg bye. If a ball that is not a no ball or wide passes the striker and runs are scored, they are called byes. If a ball that is not a no ball hits the striker but not the bat and

runs are scored, they are called leg-byes. However, leg-byes cannot be scored if the striker is neither attempting a stroke nor trying to avoid being hit. Byes and leg-byes are credited to the team's but not the batsman's total.

Mechanics of dismissal

Laws 27 to 29 discuss the main mechanics of how a batsman may be dismissed.

Law 27: Appeals. If the fielders believe a batsman is out, they may ask the umpire "How's That?", commonly shouted emphatically with arms raised, before the next ball is bowled. The umpire then decides whether the batsman is out. Strictly speaking, the fielding side must appeal for all dismissals, including obvious ones such as bowled. However, a batsman who is obviously out will normally leave the pitch without waiting for an appeal or a decision from the umpire.

Law 28: The wicket is down. Several methods of being out occur when the wicket is put down. This means that the wicket is hit by the ball, or the batsman, or the hand in which a fielder is holding the ball, and at least one bail is removed.

Law 29: Batsman out of his ground. The batsmen can be run out or stumped if they are out of their

Page 5: DICE CRICKET

ground. A batsman is in his ground if any part of him or his bat is on the ground behind the popping crease. If both batsman are in the middle of the pitch when a wicket is put down, the batsman closer to that end is out.

Ways to get out

Laws 30 to 39 discuss the various ways a batsman may be dismissed. In addition to these 10 methods, a batsman may retire out. That provision is in Law 2. Of these, caught is generally the commonest, followed by bowled, leg before wicket, run out and stumped. The other forms of dismissal are very rare.

Law 30: Bowled. A batsman is out if his wicket is put down by a ball delivered by the bowler. It is irrelevant whether the ball has touched the bat, glove, or any part of the batsman before going on to put down the wicket, though it may not touch another player or an umpire before doing so.

Law 31: Timed out. An incoming batsman must be ready to face a ball (or be at the crease with his partner ready to face a ball) within 3 minutes of the outgoing batsman being dismissed, otherwise the incoming batsman will be out.

Law 32: Caught. If a ball hits the bat or the hand holding the bat and is then caught by the opposition within the field of play before the ball bounces, then the batsman is out.

Law 33: Handled the ball. If a batsman willfully handles the ball with a hand that is not touching the bat without the consent of the opposition, he is out.

Law 34: Hit the ball twice. If a batsman hits the ball twice, other than for the sole purpose of protecting his wicket or with the consent of the opposition, he is out.

Law 35: Hit wicket. If, after the bowler has entered his delivery stride and while the ball is in play, a batsman puts his wicket down by his bat or his body he is out. The striker is also out hit wicket if he puts his wicket down by his bat or his body in setting off for a first run. "Body" includes the clothes and equipment of the batsman.

Law 36: Leg before wicket (LBW). If the ball hits the batsman without first hitting the bat, but would have hit the wicket if the batsman was not there, and the ball does not pitch on the leg side of the wicket, the batsman will be out. However, if the ball strikes the batsman outside the line of the off-stump, and the batsman was

Page 6: DICE CRICKET

attempting to play a stroke, he is not out.

Law 37: Obstructing the field. If a batsman willfully obstructs the opposition by word or action, he is out.

Law 38: Run out. A batsman is out if at any time while the ball is in play no part of his bat or person is grounded behind the popping crease and his wicket is fairly put down by the opposing side.

Law 39: Stumped. A batsman is out when the wicket-keeper (see Law 40) puts down the wicket, while the batsman is out of his crease and not attempting a run.

II. Existing forms of the Game

Dice cricket is not so common by name but pocket cricket and hand cricket are the different versions of the game. In pocket cricket, developed by Hamish Sterling and Paul McLellan is an easy game which gives everyone a chance to feel like a century batsman. The game is played in teams and includes six dice, 3 for bowling and 3 for batting. The batting side dices includes one for runs(eg,1 2

4 6) Another for aggressive shots(like hook shot,pull shot). The bowling side dices have one for different wickets like bowled,stumped,etc. Another for giving extra runs. The players need to keep a record of the runs and wickets. So pocket cricket needs pen and paper.

Hand Cricket is a team sport played mainly by school pupils and university students in the United Kingdom and Salesian College students on the passive recreation area. Unlike cricket, it is played without a bat and a tennis ball is used instead of a traditional leather cricket ball. The aim of the game is to score more runs than the other team in a format identical to cricket. The batsmen (or more correctly handsmen) play shots using the back of their left hand as a bat, with the hands clasped together. Formerly the game was played with bare hands but recently the use of a traditional cricket batting glove has become popular as it gives the batsman greater power to his shots and removes the discomfort of laying against fast bowling.

Page 7: DICE CRICKET

III. Proposed version

a) ALGORITHMThe algorithm proposed for the game is as follows –

1.When the run button is clicked, user clicks on the start button.

2.Initially, runs=0;wickets=0;overs=0,balls=0.

3.To start the game, the dice is rolled. The number that comes on the dice is then entered in the answer box.

4.The user starts from zero, counts the number of buttons equal to the answer and clicks on the last button where the count is the number on the dice.

5.If the button clicked is a blue number button then that many runs are added to the total score and the player had to roll the dice again.

6.If the button clicked is a red button then the player loses a

wicket and he has to roll the dice again.

7.The player continues to roll the dice and move along the button path provided.

8.If the total number of wickets adds upto five, then the game terminates.

9.If the player wants to continue playing he needs to start a new game by clicking the start button.

The player gets messages of how to proceed in the game. Also, whenever the player loses a wicket, he is informed on what grounds he is dismissed.

Page 8: DICE CRICKET

b) Coding

The coding for the different objects used in the game are as follows –

1.

2.

3.

4.

5.

6.

7.

Page 9: DICE CRICKET

8.

9.

10.

11.

12.

13.

14.

15.

Page 10: DICE CRICKET

16.

17.

18.

19.

20.

21.

22.

Page 11: DICE CRICKET

23.24.

25.

26.

27.

28.29.

Page 12: DICE CRICKET

30.

31.

32.

Page 13: DICE CRICKET

IV. SNAPSHOTS OF THE GAME IN PROGRESS

1.

2.

3.

4.

Page 14: DICE CRICKET

V. CONCLUSION

The game ‘Dice cricket’ proposed and coded gives a enhanced virtual experience of the board game “ludo” integrating it with otherwise field game cricket. This game is intended for those who enjoy the virtual experience of playing on their computers. The aim of this game was to integrate an indoor board game with an outdoor game of Cricket. Thus not only does this game come in handy for all of those who like gaming but is also very novel as this game is first of its kind.

VI. Future Implementation

The present version of this game is the beta version in which a lot more additions can be made. The

immediate next version intends to make the transition between the various buttons on the home window automatic, meaning that instead of the user moving manually through the buttons, the console of the game will keep the record of the last position of the run button last pressed.

Also we intend to introduce animation of the cricketers rolling the dice and making the game more interactive and worth the while.

Acknowledgement

First and foremost I offer my sincerest gratitude to our supervisor, Prof. B Persis Urbana Ivy who has supported us thoughout our project with her patience and knowledge whilst allowing us the room to work in my own way. In my daily work I have been blessed with a friendly and cheerful group of fellow students.

VII. References

[1] Hand cricket from www.wikipedia.com.

[2]Pocket cricket from www.wikipedia.com

Page 15: DICE CRICKET

[3]Pocket cricket from www.youtube.com

[4]General Rules of cricket from www.wikipedia.com