Даулетбек Досай 404 группа (КФ) VirtualTurtle 10962
Воробьев Егор Александрович, 419/2 (КФ) VirtualTurtle 10097
n1def turtle(start_pos, orientation):n1def turtle(coord, direction):
2    pos_x, pos_y = start_pos2    x, y = coord
3    while True:3    while True:
t4        action = (yield (pos_x, pos_y))t4        command = (yield (x, y))
5        if action == 'f':5        if command == 'f':
6            if orientation == 0:6            if direction == 0:
7                pos_x += 17                x += 1
8            elif orientation == 1:8            elif direction == 1:
9                pos_y += 19                y += 1
10            elif orientation == 2:10            elif direction == 2:
11                pos_x -= 111                x -= 1
12            elif orientation == 3:12            elif direction == 3:
13                pos_y -= 113                y -= 1
14        elif action == 'l':14        elif command == 'l':
15            orientation = (orientation + 1) % 415            direction = (direction + 1) % 4
16        elif action == 'r':16        elif command == 'r':
17            orientation = (orientation - 1) % 417            direction = (direction - 1) % 4
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op