{
  "format": "tokbit",
  "version": 1,
  "name": "Plný obdélník",
  "main": [
    {
      "id": "u14",
      "kind": "call",
      "call": "background(BLACK)"
    },
    {
      "id": "u15",
      "kind": "call",
      "call": "border(BLACK)"
    },
    {
      "id": "u16",
      "kind": "call",
      "call": "cls()"
    },
    {
      "id": "u17",
      "kind": "call",
      "call": "color(YELLOW)"
    },
    {
      "id": "u18",
      "kind": "call",
      "call": "ramecek(10, 5, 20, 8)",
      "comment": "Volání funkce: rámeček od sloupce 10 a řádku 5, široký 20 a vysoký 8."
    },
    {
      "id": "u19",
      "kind": "call",
      "call": "color(LIGHT_GREEN)"
    },
    {
      "id": "u20",
      "kind": "call",
      "call": "ramecek(4, 15, 32, 4)"
    },
    {
      "id": "u21",
      "kind": "call",
      "call": "color(LIGHT_RED)"
    },
    {
      "id": "u22",
      "kind": "call",
      "call": "plny(32, 1, 6, 3)"
    },
    {
      "id": "u23",
      "kind": "call",
      "call": "color(WHITE)"
    },
    {
      "id": "u24",
      "kind": "call",
      "call": "at(12, 9)"
    },
    {
      "id": "u25",
      "kind": "output",
      "values": "\"Tokbit kreslí\"",
      "newline": false
    },
    {
      "id": "u26",
      "kind": "call",
      "call": "at(0, 20)"
    }
  ],
  "functions": [
    {
      "name": "ramecek",
      "params": [
        {
          "name": "x",
          "type": "int"
        },
        {
          "name": "y",
          "type": "int"
        },
        {
          "name": "sirka",
          "type": "int"
        },
        {
          "name": "vyska",
          "type": "int"
        }
      ],
      "returnType": null,
      "blocks": [
        {
          "id": "u1",
          "kind": "for",
          "variable": "i",
          "range": "sirka",
          "body": [
            {
              "id": "u2",
              "kind": "call",
              "call": "at(x + i, y)"
            },
            {
              "id": "u3",
              "kind": "output",
              "values": "\"#\"",
              "newline": false
            },
            {
              "id": "u4",
              "kind": "call",
              "call": "at(x + i, y + vyska - 1)"
            },
            {
              "id": "u5",
              "kind": "output",
              "values": "\"#\"",
              "newline": false
            }
          ]
        },
        {
          "id": "u6",
          "kind": "for",
          "variable": "j",
          "range": "vyska",
          "body": [
            {
              "id": "u7",
              "kind": "call",
              "call": "at(x, y + j)"
            },
            {
              "id": "u8",
              "kind": "output",
              "values": "\"#\"",
              "newline": false
            },
            {
              "id": "u9",
              "kind": "call",
              "call": "at(x + sirka - 1, y + j)"
            },
            {
              "id": "u10",
              "kind": "output",
              "values": "\"#\"",
              "newline": false
            }
          ]
        }
      ],
      "comment": "Rámeček na pozici x, y o dané šířce a výšce: horní a dolní, pak boční strany."
    },
    {
      "name": "plny",
      "params": [
        {
          "name": "x",
          "type": "int"
        },
        {
          "name": "y",
          "type": "int"
        },
        {
          "name": "sirka",
          "type": "int"
        },
        {
          "name": "vyska",
          "type": "int"
        }
      ],
      "returnType": null,
      "blocks": [
        {
          "id": "u11",
          "kind": "for",
          "variable": "j",
          "range": "vyska",
          "body": [
            {
              "id": "u12",
              "kind": "call",
              "call": "at(x, y + j)"
            },
            {
              "id": "u13",
              "kind": "output",
              "values": "\"#\" * sirka",
              "newline": false
            }
          ]
        }
      ],
      "comment": "Plný obdélník: řádek po řádku, v každém sirka znaků #."
    }
  ],
  "comment": "Řešení úlohy „Plný obdélník“: Napiš novou funkci plny(x, y, sirka, vyska), která obdélník celý vyplní znakem #, a nakresli jím obdélník."
}
