Example #1
0
import testUtility
import random
from collections import defaultdict

# Get player names
player_names = ["Annie", "*Ben", "*Carla"]

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

# generate the box of cards
box = testUtility.getBox(nV)

supply_order = testUtility.getOrder()

# pick 10 cards from box to be in supply
supply = testUtility.pick10(box)

# add default cards to supply
testUtility.addDefaultSupplyCards(supply, nV, nC, player_names)

# initialize the trash
trash = []

# Costruct the Player objects
players = []
testUtility.createPlayers(players, player_names)
Example #2
0
import random
from collections import defaultdict

#Get player names
player_names = ["Annie","*Ben","*Carla"]

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

#Define box
##TEST CASE: DOUBLE THE NUMBER OF GARDENS IN THE GAME
box = testUtility.getBox(2*nV)


#box = {}
#box["Woodcutter"]=[Dominion.Woodcutter()]*10
#box["Smithy"]=[Dominion.Smithy()]*10
#box["Laboratory"]=[Dominion.Laboratory()]*10
#box["Village"]=[Dominion.Village()]*10
#box["Festival"]=[Dominion.Festival()]*10
#box["Market"]=[Dominion.Market()]*10
#box["Chancellor"]=[Dominion.Chancellor()]*10
#box["Workshop"]=[Dominion.Workshop()]*10
#box["Moneylender"]=[Dominion.Moneylender()]*10
#box["Chapel"]=[Dominion.Chapel()]*10
#box["Cellar"]=[Dominion.Cellar()]*10
#box["Remodel"]=[Dominion.Remodel()]*10
Example #3
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)
Example #4
0
import random
from collections import defaultdict
import Dominion
import testUtility
#Get player names
player_names = ["Annie","*Ben","*Carla"]

#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.getBox(1) # fewer cards generated than required by the rules



#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.getSupply(0, nC, supply, player_names) # if nV is 0, then the game is ended automatically as there are no estates, duchy or province to be given

#initialize the trash
trash = []