Putting It All Together
Lesson: BINGO!
A Brief Description of the BINGO Programs
Our implementation of the BINGO game in Java
is a client/server application,
and as such, is comprised of two Java programs that run
in separate Java Virtual Machines.
The Game application is the server,
and the Player application is the client.
The Game
The Game manages BINGO games.
It registers players and generates the cards that they play with,
starts and stops games,
announces the balls as they are chosen from the bag of balls,
verifies winning cards,
prevents players from being a nuisance,
and provides status to game listeners.
The Player
The Player provides the interface
for users to interact with the BINGO game.
To play, a user pushes the Join the Next Game
button. If the Player is allowed to play,
the Game gives some BINGO cards to the player.
As the game proceeds the user marks the card as balls are announced.
When the card has a BINGO (5 in a row, column, or diagonal) the
user clicks a button which notifies the Game of the win.
The Flow of the Game
Here's a chart that describes the flow of the BINGO game.
together/GameFlow toptogether/GameFlow 460476ALIGNNATURALSIZEFLAG3
This figure has been reduced to fit on the page.
Click the image to view it at its natural size.
The flow chart leaves out some details but basically the
flow of the game is as follows:
-
A Game starts up.
-
A Player starts up. Other players may also start up.
-
The first Player joins the next game.
To join a game, a user must enter some information
into the GUI and click the Join the Next Game button.
The Player application sends the information to the
Game who returns a Player ID and some BINGO cards
to play with. The BINGO cards are displayed by the Player.
-
After the first Player has joined a game, the Game begins
a countdown to the beginning of the game. Players can continue
to join the game until the countdown is over. Then the game begins.
-
To start a game, the Game just starts announcing balls--there is no
announcement of the beginning of the game.
-
The Player application displays the newest ball and all
of the balls announced to date. The user
checks the card against the balls announced and
looks for a BINGO (5 in a row, column, or diagonal).
-
When a user notices a BINGO, s/he clicks the
BINGO! I Won! BINGO! button.
The Player application sends the Player ID and the winning
card to the Game.
-
The Game pauses the game (stops announcing balls)
while it verifies the Player ID and the card. The card
must have been signed for the current game by this Game application and
it must have a BINGO. If indeed we have a winner, then the game
is over and the Game sends the "end-of-gameball.
If the card was not a winner, then the Player "cried wolfand is given a warning. Three wolf cries and the player is
kicked out of the game.
-
After the game is over, the user can clear the Player
application and join the next game, or quit the Player application.
After the game is over, the Game automatically clears its
status display, and waits for the first player to join the next game.
To get a better understanding of the flow of the game, you should
play. The "letsplaynext section shows you how.
Bhopal news
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100