Exemplo n.º 1
0
    def test_deck10combined2(self):
        cards = Deck(10)
        instr = ['cut 6', 'deal with increment 7', 'deal into new stack']
        shuffle = day_22.readInstructions(instr)
        day_22.moveCards(shuffle, cards)

        self.assertEqual(cards.deck, [3, 0, 7, 4, 1, 8, 5, 2, 9, 6])
Exemplo n.º 2
0
 def test_deck10combined1(self):
     cards = Deck(10)
     instr = [
         'deal with increment 7', 'deal into new stack',
         'deal into new stack'
     ]
     shuffle = day_22.readInstructions(instr)
     day_22.moveCards(shuffle, cards)
     self.assertEqual(cards.deck, [0, 3, 6, 9, 2, 5, 8, 1, 4, 7])
Exemplo n.º 3
0
    def test_deck10combined3(self):
        cards = Deck(10)

        instr = [
            'deal with increment 7', 'deal with increment 9', 'cut -2',
            'shuffle = day_22.readInstructions(instr)',
            'day_22.moveCards(shuffle,cards)'
        ]
        shuffle = day_22.readInstructions(instr)
        day_22.moveCards(shuffle, cards)
        self.assertEqual(cards.deck, [6, 3, 0, 7, 4, 1, 8, 5, 2, 9])
Exemplo n.º 4
0
    def test_deck10combined4(self):
        cards = Deck(10)

        instr = [
            'deal into new stack', 'cut -2', 'deal with increment 7', 'cut 8',
            'cut -4', 'deal with increment 7', 'cut 3',
            'deal with increment 9', 'deal with increment 3', 'cut -1'
        ]

        shuffle = day_22.readInstructions(instr)
        day_22.moveCards(shuffle, cards)
        self.assertEqual(cards.deck, [9, 2, 5, 8, 1, 4, 7, 0, 3, 6])
Exemplo n.º 5
0
 def test_deck10all(self):
     cards = Deck(10)
     print(cards)
     self.assertEqual(cards.deck, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
Exemplo n.º 6
0
 def test_deck10newstack(self):
     cards = Deck(10)
     # 'deal with increment 7'
     cards.dealIntoNewStack()
     self.assertEqual(cards.deck, [9, 8, 7, 6, 5, 4, 3, 2, 1, 0])
Exemplo n.º 7
0
 def test_deck10cutneg4(self):
     cards = Deck(10)
     # 'deal with increment 7'
     cards.cut(-4)
     self.assertEqual(cards.deck, [6, 7, 8, 9, 0, 1, 2, 3, 4, 5])
Exemplo n.º 8
0
 def test_deck10cut3(self):
     cards = Deck(10)
     # 'deal with increment 7'
     cards.cut(3)
     self.assertEqual(cards.deck, [3, 4, 5, 6, 7, 8, 9, 0, 1, 2])
Exemplo n.º 9
0
 def test_deck10inc3(self):
     cards = Deck(10)
     # 'deal with increment 3'
     cards.dealWithIncrement(3)
     self.assertEqual(cards.deck, [0, 7, 4, 1, 8, 5, 2, 9, 6, 3])
Exemplo n.º 10
0
 def test_deck10pos(self):
     cards = Deck(10)
     print(cards)
     self.assertEqual(cards.returnPosition(9), 9)
     self.assertEqual(cards.returnPosition(5), 5)
     self.assertEqual(cards.returnPosition(0), 0)