def back(self): self.expect(lexer.NumToken) turtle.move(-self.token.value) self.expect(lexer.DotToken)
output[2][1] = self.position # Extra End Position self.position = init_position # Reset Position return output for image in image_list: turtle = EnglishTurtle(image) turtle.get_to_start() debug_start_position = turtle.position #print(f'Image: {image.filename} \nStart Position: {turtle.position}') while turtle.next_card_is_available(): if not turtle.is_pixel_white(): turtle.move_until_white((0, 1)) turtle.move((0, 5)) try: card_position = turtle.get_card_positions() create_card(image, card_position, card_counter, image.filename[21:-4]) card_counter += 1 turtle.move_to_next_card() except: print( f'Error: {image.filename} - {turtle.position} - Start: {debug_start_position}' ) os.rename(image.filename, f'error/{image.filename}') break
def forw(self): self.expect(lexer.NumToken) turtle.move(self.token.value) self.expect(lexer.DotToken)