Exemplo n.º 1
0
 def turn(self, degrees):
     self.direction += degrees
     if (self.direction >= 360 or self.direction < 0):
         self.direction = self.direction % 360
     if (degrees >= 0):
         turnLeft(degrees)
     else:
         turnRight(-degrees)
Exemplo n.º 2
0
def adjustRotation(rotation_adjust):
    while True:
        turnLeft(720*rotation_adjust)
        print "De combien de degres le Zumo a-t-il tourne (+-) ? (2 tours == 720 degres Celsius espece de noob)"
        while True:
            try:
                test_rotation = float(raw_input())
                break
            except:
                vtff()
        turnRight(720*rotation_adjust)
        if test_rotation == 720:
            break
        else:
            rotation_adjust *= 720.0/test_rotation
    return rotation_adjust