-
Notifications
You must be signed in to change notification settings - Fork 0
/
dominion.act
118 lines (111 loc) · 2.34 KB
/
dominion.act
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
@import sys
@import random
@import dominionGame as orig
@import dominionUpdated as gok
@#import cardnames2 as c
@import cardnames as c
@
@def checkReturn(value):
@ return value
@
@def initFirstTurnTest():
@ return random.randrange(5)
@
@def numHandCards(playerhands):
@ list = []
@ list.append(len(playerhands[0]))
@ list.append(len(playerhands[1]))
@ return list
@
@def numDeckCards(playerdecks):
@ list = []
@ list.append(len(playerdecks[0]))
@ list.append(len(playerdecks[1]))
@ return list
@
@def numDiscards(playerdiscards):
@ list = []
@ list.append(len(playerdiscards[0]))
@ list.append(len(playerdiscards[1]))
@ return list
@
@def whoseTurn(game):
@ return game.whoseTurn
@
@def checkOptions(game):
@ buy = game.numBuys
@ return buy
@
@def checkPhase(game):
@ return game.phase
@
@def checkCoins(game):
@ return game.coins
@
@def checkScore1(score):
@ return score
@
@def checkScore2(score):
@ return score
@
source: dominionUpdated.py
pool: %PLAYERS% 1
pool: %R% 1 REF
pool: %G% 1 REF
pool: %KINGDOM% 1
pool: %HANDPOS% 1
pool: %CHOICE1% 1
pool: %CHOICE2% 1
pool: %SCORE% 1
~%KINGDOM% := [7,8,9,10,11,12,13,14,15,16]
~%PLAYERS% := 2
~%G% := gok.initializeGame(2,%KINGDOM%,10)
~%SCORE% := 0
%CHOICE1% := 0
%CHOICE2% := 0
%HANDPOS% := 0
%HANDPOS% := initFirstTurnTest()
%R% := gok.playCard(%HANDPOS%, %CHOICE1%, %CHOICE2%, 0, %G%)
%R% := gok.buyCard(1,%G%)
%R% := gok.buyCard(2,%G%)
%R% := gok.buyCard(3,%G%)
%R% := gok.buyCard(5,%G%)
%R% := gok.buyCard(6,%G%)
%R% := gok.buyCard(7,%G%)
%R% := gok.buyCard(8,%G%)
%R% := gok.buyCard(9,%G%)
%R% := gok.buyCard(10,%G%)
%R% := gok.buyCard(11,%G%)
%R% := gok.buyCard(12,%G%)
%R% := gok.buyCard(13,%G%)
%R% := gok.buyCard(14,%G%)
%R% := gok.buyCard(15,%G%)
%R% := gok.buyCard(16,%G%)
%SCORE% := gok.scoreFor(0,%G%)
%SCORE% := gok.scoreFor(1,%G%)
%R% := gok.isGameOver(%G%)
%R% := gok.endTurn(%G%)
%CHOICE1% := %[0..16]%
%CHOICE2% := %[0..16]%
numHandCards(%G%.hands)
numDeckCards(%G%.decks)
numDiscards(%G%.discards)
whoseTurn(%G%)
checkOptions(%G%)
checkPhase(%G%)
checkCoins(%G%)
checkReturn(%R%)
checkScore1(%SCORE%)
checkScore2(%SCORE%)
reference: gok ==> orig
#reference: hands ==> hand
#reference: decks ==> deck
#reference: discards ==> discard
compare: numHandCards
compare: numDeckCards
compare: numDiscards
compare: whoseTurn
compare: checkOptions
compare: checkPhase
compare: checkCoins
compare: checkReturn