Пример #1
0
    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']
}

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

# bug for testing
supply["Gold"] = [Dominion.Gold()] * 0

#initialize the trash
trash = []

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

#Play the game
turn = 0
while not Dominion.gameover(supply):
    turn += 1
    print("\r")
Пример #2
0
#get number of victory and curses cards
nV, nC = testUtility.get_nV_nC(player_names)

#Define box
box = testUtility.get_box(nV)

supply_order = testUtility.get_supply_order()

#Pick 10 cards from box to be in the supply.
boxlist = [k for k in box]
random.shuffle(boxlist)
random10 = boxlist[:10]
supply = defaultdict(list, [(k, box[k]) for k in random10])

#The supply always has these cards
supply = testUtility.get_supply(supply, nV, nC, player_names)

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

#initialize the trash
trash = []

#initialize turn number
turn = 0

#Play the game
testUtility.play_game(trash, turn, supply, supply_order, players)

#Announce Final score and Winners
testUtility.get_final_score(players)
Пример #3
0
"""
import testUtility

# Get player names
player_names = testUtility.get_players()

# number of curses and victory cards
nV = testUtility.get_victory_cards(
    player_names)  #12 if len(player_names) > 2 else 8 # Number Victory cards
nC = testUtility.get_curses(
    player_names)  #-10 + 10 * len(player_names) # Number Curse cards

# Box of potential cards
# box = testUtility.get_boxes(nV) # This is removed for testing purposes
box = {}  # Line added to introduce bug for Test Scenario

# Sets supplies and their values
supply_order = testUtility.get_supply_order()

# Pick 10 cards from box to be in the supply
supply = testUtility.get_supply(box)

# Add required cards
testUtility.add_required_supplies(supply, nV, nC, player_names)

# Costruct the Player objects
players = testUtility.construct_players(player_names)
print(players)
testUtility.play_game(supply, supply_order, players)

testUtility.final_score(players)
Пример #4
0
import testUtility

# Get player names
player_names = testUtility.get_player_names()

# number of curses and victory cards
nV = testUtility.get_num_victory_cards(player_names)
nC = testUtility.get_num_curse_cards(player_names)

# Define box
box = testUtility.get_box(nV)

supply_order = testUtility.get_supply_order()

# Pick 10 cards from box to be in the supply and teh cards which are always in supply
supply = testUtility.get_supply(box, player_names, nV, nC)
"""
Test Case: Change the coppers in the Supply to Curses
"""
supply["Copper"] = [Dominion.Curse()] * (60 - len(player_names) * 7)

# initialize the trash
trash = testUtility.get_trash()

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

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

# Final score