| n | def turtle(coord, direction): | n | def turtle(start_pos, orientation): | 
             |     x, y = coord |  |     pos_x, pos_y = start_pos | 
             |     while True: |  |     while True: | 
            | t |         command = (yield (x, y)) | t |         action = (yield (pos_x, pos_y)) | 
             |         if command == 'f': |  |         if action == 'f': | 
             |             if direction == 0: |  |             if orientation == 0: | 
             |                 x += 1 |  |                 pos_x += 1 | 
             |             elif direction == 1: |  |             elif orientation == 1: | 
             |                 y += 1 |  |                 pos_y += 1 | 
             |             elif direction == 2: |  |             elif orientation == 2: | 
             |                 x -= 1 |  |                 pos_x -= 1 | 
             |             elif direction == 3: |  |             elif orientation == 3: | 
             |                 y -= 1 |  |                 pos_y -= 1 | 
             |         elif command == 'l': |  |         elif action == 'l': | 
             |             direction = (direction + 1) % 4 |  |             orientation = (orientation + 1) % 4 | 
             |         elif command == 'r': |  |         elif action == 'r': | 
             |             direction = (direction - 1) % 4 |  |             orientation = (orientation - 1) % 4 |