-
Notifications
You must be signed in to change notification settings - Fork 5
/
notes.txt
48 lines (38 loc) · 1.33 KB
/
notes.txt
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
# helper file to determine where certain methods should be placed
actions:
draw a card
pickup a discard
discard a card
The GinGame will:
select players for a game
call two players to play
start a game with selected players
play a game with selected players
while (game_ending_point_limit has not been reached):
while (no player has knocked):
for each player
draw_or_pickup_discard
discard_or_knock
if gin
verify gin
count and award deadwood points
award gin points
else (a knock)
non-knocking player can play off of knocker's runs
determine which player has lowest deadwood in hand
award deadwood points to player determined in step above
increment player's win counter
if player1.points > game_ending_point_limit or player2.points > game_ending_point_limit
calculate final score
determine winner
return results of said game
The GinPlayer may:
x have a GinStrategy
x sit at a GinTable
x hold a hand
x draw a card from the deck
x draw a card from the discard pile
x discard a card
x declare a knock
x declare gin
mate with other GinPlayers