luiscobo

Mundo_Parcial_01a

Oct 17th, 2019
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 2.54 KB | None | 0 0
  1. {
  2.   "robots": [
  3.     {
  4.       "x": 1,
  5.       "y": 1,
  6.       "_prev_x": 1,
  7.       "_prev_y": 1,
  8.       "_prev_orientation": 0,
  9.       "objects": {
  10.         "star": 99
  11.       },
  12.       "_orientation": 0,
  13.       "_is_leaky": true,
  14.       "_trace_history": [],
  15.       "_trace_style": "default",
  16.       "_trace_color": "seagreen",
  17.       "__id": 3,
  18.       "model": "classic"
  19.     }
  20.   ],
  21.   "walls": {},
  22.   "description": [
  23.     "<h1>Torres en la Cueva</h1>",
  24.     "<p>",
  25.     "    La misión es instruir a Reeborg para que construyas unas",
  26.     "    torres de objetos dentro de una cueva. Adicionalmente, en ",
  27.     "    la cueva hay estalactitas en el techo, las cuáles pueden",
  28.     "    tener longitudes diferentes. ",
  29.     "</p>",
  30.     "<p>",
  31.     "    Reeborg quiere hacer que las torres sean tan altas que lleguen hasta",
  32.     "    una posición por debajo donde inicia la estalactita. Entre la parte",
  33.     "    mas alta de la torre y la estalactita debe quedar siempre un espacio,",
  34.     "    además las torres deben ser construidas solamente en las posiciones",
  35.     "    impares, es decir, en la columna 1, en la 3, en la 5, y así sucesivamente.",
  36.     "    El tamaño de la cueva es variable, y puede cambiar de ejecución en ejecución.",
  37.     "</p>",
  38.     "DIFFICULTY4",
  39.     ""
  40.   ],
  41.   "small_tiles": false,
  42.   "rows": 12,
  43.   "cols": 11,
  44.   "onload": [
  45.     "#python onload",
  46.     "import random",
  47.     "width = random.randint(6, 13)",
  48.     "height = 12",
  49.     "",
  50.     "RUR.set_world_size(width, height)",
  51.     "RUR.fill_background(\"grass\")",
  52.     "RUR.give_object_to_robot(\"star\",99)",
  53.     "",
  54.     "#Create some stalactites",
  55.     "",
  56.     "obstacles = []",
  57.     "for i in range(width):",
  58.     "    h = random.randint(8,12)",
  59.     "    obstacles.append(h)",
  60.     "    RUR.add_wall(\"south\",i+1,h)",
  61.     "",
  62.     "#build the sides of the walls  ",
  63.     "",
  64.     "for i in range(width-1):",
  65.     "    n = obstacles[i]",
  66.     "    n2 = obstacles[i+1]",
  67.     "    if n < n2:",
  68.     "        for j in range(n,n2):",
  69.     "            RUR.add_wall(\"east\",i+1,j)    ",
  70.     "    elif n2 < n:",
  71.     "        for j in range(n2,n):",
  72.     "            RUR.add_wall(\"east\",i+1,j)  ",
  73.     "        ",
  74.     "#fill in mud",
  75.     "for i in range(width):",
  76.     "    for j in range(obstacles[i],13):",
  77.     "        RUR.add_obstacle(\"mud\",i+1,j)",
  78.     "",
  79.     "#create goals",
  80.     "options = {'goal' : True}",
  81.     "for x in range(0, width,2):",
  82.     "    for y in range(1,obstacles[x]-1):",
  83.     "        RUR.add_object(\"star\", x+1,y, options)    ",
  84.     "",
  85.     ""
  86.   ]
  87. }
Advertisement
Add Comment
Please, Sign In to add comment