Esempio n. 1
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)
Esempio n. 2
0
import testUtility
from collections import defaultdict

# Get player names
player_names = testUtility.get_player_names()

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

# Define box
box = testUtility.get_box(nV)
supply_order = testUtility.get_supply_order()  # correct version

# Pick 10 cards from box to be in the supply.
boxList = [k for k in box]
random.shuffle(boxList)
# random10 = boxList[:10]   # The correct version
random10 = boxList[:12]  # The test version
supply = defaultdict(list, [(k, box[k]) for k in random10])

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

# initialize the trash
trash = []

# Construct the Player objects