示例#1
0
import Dominion
import random
import testUtility
from collections import defaultdict

#Get player names
player_names = ["*Ryan"]

#number of curses and victory cards
if len(player_names) > 2:
    nV = 12
else:
    nV = 8
nC = -10 + 10 * len(player_names)

box = testUtility.GetBoxes(nV)

#Pick 10 cards from box to be in the supply.
supply = testUtility.pickCards(box, player_names, nV, nC)

#initialize the trash
trash = []

#Costruct the Player objects
players = testUtility.makePlayers(player_names)

#Play the game
testUtility.playGame(supply, players, trash)

#Final score
testUtility.finalScore(players)
示例#2
0
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 13 10:27 2020

@author: Manda Jensen (mp-jensen)
"""

import testUtility

#Set the player names
#Introduce Test Scenario: Setting up the game with too many players
player_names = [
    "Annie", "*Ben", "*Carla", "*Josh", "*Rich", "*Judy", "*Susie", "*Erik"
]

#get the card box
box = testUtility.getBox(player_names)

#get the card supply for this specific game
supply = testUtility.getSupply(box, player_names)

#get the player objects
players = testUtility.getPlayers(player_names)

#Play the game
testUtility.playGame(supply, players)

#Calculate and print the final score
testUtility.scoreGame(players)
示例#3
0
        '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)
示例#4
0
player_names = ["Annie", "*Ben", "*Carla"]

supply_order = {
    0: ['Curse', 'Copper'],
    2: ['Estate', 'Cellar', 'Chapel', 'Moat'],
    3: ['Silver', 'Chancellor', 'Village', 'Woodcutter', 'Workshop'],
    4: [
        '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']
}

nV, nC = refactor.numCursesVictory(player_names)

#Define box
box = {}
supply = refactor.getSupply(nV, box)

refactor.addSupplyStandard(supply, player_names, nV, nC)

trash, players = refactor.initializeGame(player_names)

refactor.playGame(supply_order, players, supply, trash)

refactor.calcFinalScore(players)