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,
- "objects": {},
- "_orientation": 0,
- "possible_initial_positions": [
- [
- 1,
- 1
- ]
- ],
- "_is_leaky": true,
- "_trace_history": [],
- "_trace_style": "default",
- "_trace_color": "seagreen",
- "__id": 7,
- "model": "light blue"
- }
- ],
- "walls": {},
- "description": [
- "<h1>Tablero de Damas: el reto</h1>",
- "<p> Hay que ayudar a Reeborg a armar un tablero de damas en el patio donde vive.",
- " Lo bueno es que tiene suficientes «tokens» en su bolsa para colocarlos en el",
- " patio en los lugares que corresponda. Tenga en cuenta que la dificultad más ",
- " grande que se deriva de este problema tiene que ver con el tamaño variable ",
- " del mundo. El número de filas y el número de columnas del patio cambia, y así ",
- " también el número de tokens que hay que colocar en los lugares correspondientes.</p>",
- "DIFFICULTY9",
- " "
- ],
- "small_tiles": false,
- "rows": 10,
- "cols": 10,
- "onload": [
- "var width, height, x, y, nb_object;",
- "RUR.MAX_STEPS = 3000;",
- "width = RUR.randint(3, 14);",
- "height = RUR.randint(3, 14);",
- "",
- "RUR.set_model('light blue');",
- "RUR.set_world_size(width, height);",
- "",
- "",
- "for (x=1; x<= width; x++) {",
- " for (y=1; y<=height; y++) {",
- " if ( (x+y)%2 == 0) {",
- " RUR.add_object(\"token\", x, y, {goal: true});",
- " RUR.add_colored_tile(\"black\", x, y);",
- " } else {",
- " RUR.add_colored_tile(\"beige\", x, y);",
- " }",
- " }",
- "}",
- "// give Reeborg more than the number of tokens required",
- "// so that we cannot use the information about",
- "// whether or not we still have tokens to determine if",
- "// the task has been accomplished.",
- "RUR.give_object_to_robot(\"token\", width*height);",
- ""
- ]
- }
Advertisement
Add Comment
Please, Sign In to add comment