def setUp(self): # Get player names self.player_names = testUtility.getPlayerNames() # number of curses and victory cards self.nV = testUtility.getnV(self.player_names) self.nC = testUtility.getnC(self.player_names) # Get box self.box = testUtility.getBoxes(self.nV) # Get supply order self.supply_order = testUtility.getSupplyOrder() # Pick 10 cards from box to be in the supply. self.boxlist = testUtility.getBoxList(self.box) self.random10 = testUtility.getRandom10(self.boxlist) self.supply = testUtility.getSupply(self.box, self.random10) # The supply always has these cards self.supply = testUtility.getDefaultSupply(self.supply, self.player_names, self.nV, self.nC) # initialize the trash self.trash = [] # Construct the Player objects self.players = testUtility.getPlayers(self.player_names) # Instantiate player self.player = Dominion.Player('Annie')
def set_up(self): self.player_names = testUtility.getPlayers() self.nV = testUtility.getVictoryCards(self.player_names) self.nC = testUtility.getCurseCards(self.player_names) self.box = testUtility.getBoxes(self.nV) self.supply = testUtility.getSupply(self.nV, self.nC, self.player_names, self.box)
def setUp(self): #Data Setup self.player_names = ["Annie","*Ben","*Carla"] self.players = testUtility.getPlayers(self.player_names) self.nV = testUtility.numVic(self.players) self.nC = testUtility.getCurses(self.players) self.box = testUtility.getBoxes(self.nV) self.supply_order = testUtility.getSupplyOrder() self.supply = testUtility.getSupply(self.box) testUtility.setSupply(self.supply, self.players, self.nV, self.nC) self.trash = [] self.player = Dominion.Player('Annie')
'Gardens', 'Bureaucrat', 'Feast', 'Militia', 'Moneylender', 'Remodel', 'Smithy', 'Spy', 'Thief', 'Throne Room' ], 5: [ 'Duchy', 'Market', 'Council Room', 'Festival', 'Laboratory', 'Library', 'Mine', 'Witch' ], 6: ['Gold', 'Adventurer'], 8: ['Province'] } #Pick 10 cards from box to be in the supply. boxlist = [k for k in box] random.shuffle(boxlist) random10 = boxlist[:25] supply = defaultdict(list, [(k, box[k]) for k in random10]) #The supply always has these cards testUtility.setSupply(supply, player_names, nV, nC) #initialize the trash trash = [] #Costruct the Player objects players = testUtility.getPlayers(player_names) #Play the game testUtility.playGame(supply, supply_order, players, trash) #Final score testUtility.score(players)
player_names = tU.getPlayerNames() # number of curses and victory cards nV = tU.getNumberOfVictoryCards(len(player_names)) nC = tU.getNumberOfCurses(len(player_names)) # Define box and supply box = tU.getFullBox(nV) supply_order = tU.getSupplyOrder() supply = tU.getSupplyFromBox(box, len(player_names), nV, nC) # initialize the trash trash = [] # Construct the Player objects players = tU.getPlayers(player_names) ######################### # TEST SCENARIO 1 supply["Province"] = [] ######################### # Play the game turn = 0 while not Dominion.gameover(supply): turn += 1 print("\r") for value in supply_order: print(value)