Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "robots": [
- {
- "x": 1,
- "y": 1,
- "_prev_x": 1,
- "_prev_y": 1,
- "_prev_orientation": 0,
- "_orientation": 0,
- "_is_leaky": true,
- "_trace_history": [],
- "_trace_style": "default",
- "_trace_color": "seagreen",
- "__id": 5,
- "model": "classic"
- }
- ],
- "walls": {},
- "description": [
- "<h1>Torres en la Cueva</h1>",
- "<p>",
- " La misión es instruir a Reeborg para que construyas unas",
- " torres de objetos dentro de una cueva. Adicionalmente, en ",
- " la cueva hay estalactitas en el techo, las cuáles pueden",
- " tener longitudes diferentes. ",
- "</p>",
- "<p>",
- " Reeborg quiere hacer que las torres sean tan altas que lleguen hasta",
- " una posición por debajo donde inicia la estalactita. Entre la parte",
- " mas alta de la torre y la estalactita debe quedar siempre un espacio,",
- " además las torres deben ser construidas solamente en las posiciones",
- " impares, es decir, en la columna 1, en la 3, en la 5, y así sucesivamente.",
- " El tamaño de la cueva es variable, y puede cambiar de ejecución en ejecución.",
- "</p>",
- "DIFFICULTY4",
- ""
- ],
- "small_tiles": false,
- "rows": 12,
- "cols": 13,
- "onload": [
- "#python onload",
- "import random",
- "width = random.randint(6, 13)",
- "height = 12",
- "",
- "RUR.set_world_size(width, height)",
- "RUR.fill_background(\"grass\")",
- "RUR.give_object_to_robot(\"star\",99)",
- "RUR.give_object_to_robot(\"square\",99)",
- "",
- "#Create some stalactites",
- "",
- "obstacles = []",
- "for i in range(width):",
- " h = random.randint(8,12)",
- " obstacles.append(h)",
- " RUR.add_wall(\"south\",i+1,h)",
- "",
- "#build the sides of the walls ",
- "",
- "for i in range(width-1):",
- " n = obstacles[i]",
- " n2 = obstacles[i+1]",
- " if n < n2:",
- " for j in range(n,n2):",
- " RUR.add_wall(\"east\",i+1,j) ",
- " elif n2 < n:",
- " for j in range(n2,n):",
- " RUR.add_wall(\"east\",i+1,j) ",
- " ",
- "#fill in mud",
- "for i in range(width):",
- " for j in range(obstacles[i],13):",
- " RUR.add_obstacle(\"mud\",i+1,j)",
- "",
- "#create goals",
- "options = {'goal' : True}",
- "for x in range(0, width,2):",
- " for y in range(1,obstacles[x]-1):",
- " RUR.add_object(\"square\", x+1,y, options) ",
- "",
- ""
- ]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement