예제 #1
0
파일: driver.py 프로젝트: CallanIwan/Aranha
 def turn(self, direction):
     #print "spider.turn(" + str(direction) + ")"
     main.turn(direction)
예제 #2
0
 def test_last(self):
     sticks = 1
     comp_takes = turn(sticks)
     self.assertEqual(comp_takes, 1)
예제 #3
0
 def test_win_condition(self):
     sticks_left = [21, 17, 13, 9, 5, 1]
     for sticks in range(2, 20):
         if sticks not in sticks_left:
             comp_takes = turn(sticks)
             self.assertTrue((sticks - comp_takes) in sticks_left)
예제 #4
0
 def test_right_result(self):
     sticks = range(4, 21)
     for s in sticks:
         comp_takes = turn(s)
         self.assertTrue(1 <= comp_takes <= 3)
예제 #5
0
 def test_three(self):
     sticks = 3
     comp_takes = turn(sticks)
     self.assertEqual(comp_takes, 2)
예제 #6
0
 def test_two(self):
     sticks = 2
     comp_takes = turn(sticks)
     self.assertEqual(comp_takes, 1)