Beispiel #1
0
print "Test declareTrump()"
cdOnDesk = [[],[],[]]
declareCards = p1.declareTrump(cdOnDesk)
if declareCards == False:#not declared
    print str(p1) + " does not want to declare trump."
else:#delcare trump
    print str(p1) + " wants to declare trump using these cards:"
    for item in declareCards:
        print item
print "\n\n"

################################################################################
#test replaceBottom()
print "Test replaceBottom()"
print "Old bottom:"
for item in d1.getBottom():
    print item
newBottom = p1.replaceBottom(d1.getBottom())
print "Try to replace the bottom with these cards:"
for item in newBottom:
    print item

print "deck.bottom should not have been changed at this stage since we need Game to call deck.changeBottom() to Actually change deck.bottom"
print "Let's check if deck.bottom is still the old one:"
for item in d1.getBottom():
    print item
print "\n\n"


################################################################################
#test declareToPlayCards()
Beispiel #2
0
from deck import Deck
from card import Card
import pdb

#test Deck.changeBottom()
#correct operation
d1 = Deck()
get = d1.getBottom()
get = get[0:3]
put = [Card(3),Card(5),Card(19)]
d1.changeBottom(get,put,debug = 1)

#try to put 4 cards into the bottom while require other than 4
put = [Card(3),Card(5),Card(19),Card(33)]
d1.changeBottom(get,put,debug = 1)

#try to require some cards that are not in the bottom
d2 = Deck()
get = d2.getBottom()
get = get[0:4]
get[0] = Card(1)#this is probably not in the bottom
put = [Card(3),Card(5),Card(19),Card(33)]
d1.changeBottom(get,put,debug = 1)




#test Deck.popCard()
d3 = Deck()
top1 = d3.getTop()
print "How many cards are in the top?"