Vytvoř 5x5 mřížku, která bude reprezentovat fantasy mapu. Na 10 míst vlož emoji předmětu…
- User
Vytvoř 5x5 mřížku, která bude reprezentovat fantasy mapu. Na 10 míst vlož emoji předmětu (můžeš si vybrat nějaké fantastické). Pak přidej na [1,1] (horní dolní roh) mou postavu. Vytvoř druhou mřížku, která bude na začátku kopií té první. Moje postava půjde těmito směry: nahoru, nahoru, doprava, doprava, doprava. Pokud postava prošla políčkem, dej do něj emoji šipky se směrem. Pod mapu pak napiš inventář předmětů, které moje postava našla po cestě.
Assistant
import random # Functí po sebe používají doplněné magické emoji. emojis = { 'horn': '🦄', 'forest': '🌲', 'river': '🌊', 'mountain': '⛰️', 'castle': '🏰', 'goblin': '👺', 'unicorn': '🦄', 'dragon': '🐉', 'treasure': '💰', 'mystical_tree': '🌿' } def generate_map(size=5): map_grid = [[random.choice(list(emojis.values())) for _ in range(size)] for _ in range(size)] map_grid[0][0] = emojis['horn'] return map_grid def move_and_collect(map_grid, directions): position = (0, 0) inventory = [] try: for direction in directions: if direction == 'north': position = (position[0], position[1] - 1) elif direction == 'south': position = (position[0], position[1] + 1) elif direction == 'east': position = (position[0] + 1, position[1]) elif direction == 'west': position = (position[0] - 1, position[1]) map_grid[position[0]][position[1]] = emojis['montain'] if position == (0, 4) else emojis['goblin'] if map_grid[position[0]][position[1]] in emojis.values(): inventory.append(map_grid[position[0]][position[1]]) except IndexError: print("Out of bounds move!") return map_grid, inventory # Create the first map and move the character original_map = generate_map() path = ['north', 'north', 'east', 'east', 'east'] collected_items, new_map = move_and_collect(original_map, path) # Create the second map and move the character in the same path duplicated_map = generate_map() collected_items_2, new_map_2 = move_and_collect(duplicated_map, path) # Print the maps and collected items print("Original Map:") for row in original_map: print(' '.join(row)) print("Collected Items:", collected_items) print("\nDuplicated Map:") for row in new_map_2: print(' '.join(row)) print("Collected Items:", collected_items_2)
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.