def test_times_triggeru2(self): c = qb.Cube() d = qb.Cube() for times in [1, 2, 3, 4]: c.trigger_u2(times) for i in range(times): d.trigger_u2() self.assertEqual(c, d)
def test_times_triggeru2_large_positive(self): c = qb.Cube() d = qb.Cube() large_positive_times = 9999999999 effective_times = large_positive_times % 2 c.trigger_u2(large_positive_times) d.trigger_u2(effective_times) self.assertEqual(c, d)
def main(serialPort): cube = cubey.Cube(serialPort) commandNumber = 0 try: while True: # letters = pickRandomLetters() # numbers = pickRandomNumbers() letters = pickSetOfBadLetters() numbers = pickSetOfBadNumbers() command = "w " + letters if len(numbers) != 0: command += " " + numbers result = cube.sendCommand(command) commandNumber += 1 if commandNumber % 100 == 0: print "Command %d is: %s" % (commandNumber, command) # if result is None: # print "Invalid command found: " + command if result is not None: print "Valid command found: " + command except KeyboardInterrupt: print print "Done!"
def main(serialPort): cube = cubey.Cube(serialPort) cubeCommand = CubeCommand(cube) try: cubeCommand.cmdloop() except KeyboardInterrupt: print
def main(serialPort): cube = cubey.Cube(serialPort) print "Listening, Ctrl-C to stop..." try: while True: rawMessage = cube.sendCommand("m n u") printMessage(rawMessage) except KeyboardInterrupt: print cube.breakOut() print "Done!"
def test_f(self): c = qb.Cube() c.f() front_face = [[R, R, R], [R, R, R], [R, R, R]] back_face = [[P, P, P], [P, P, P], [P, P, P]] right_face = [[W, B, B], [W, B, B], [W, B, B]] left_face = [[G, G, Y], [G, G, Y], [G, G, Y]] up_face = [[W, W, W], [W, W, W], [G, G, G]] down_face = [[B, B, B], [Y, Y, Y], [Y, Y, Y]] self.assertEqual(c._F, front_face) self.assertEqual(c._B, back_face) self.assertEqual(c._R, right_face) self.assertEqual(c._L, left_face) self.assertEqual(c._U, up_face) self.assertEqual(c._D, down_face)
def test_sune_6(self): c = qb.Cube() c.sune(6) self.assertTrue(c.is_solved())
def test_trigger_u2_2(self): c = qb.Cube() c.trigger_u2(2) self.assertTrue(c.is_solved())
def test_times_trigger_u2_negative(self): c = qb.Cube() c.trigger_u2(-1) self.assertTrue(c.is_solved())
def test_times_trigger_0(self): c = qb.Cube() c.trigger_u2(0) self.assertTrue(c.is_solved())
def test_trigger_4(self): c = qb.Cube() c.trigger(4) self.assertTrue(c.is_solved())
def test_equal(self): c = qb.Cube() d = qb.Cube() self.assertTrue(c == d)
def test_solved(self): c = qb.Cube() self.assertTrue(c.is_solved())