{
  "format": "tokbit",
  "version": 1,
  "name": "Three frames",
  "main": [
    {
      "id": "u11",
      "kind": "call",
      "call": "background(BLACK)"
    },
    {
      "id": "u12",
      "kind": "call",
      "call": "border(BLACK)"
    },
    {
      "id": "u13",
      "kind": "call",
      "call": "cls()"
    },
    {
      "id": "u14",
      "kind": "call",
      "call": "color(YELLOW)"
    },
    {
      "id": "u15",
      "kind": "call",
      "call": "frame(10, 5, 20, 8)",
      "comment": "A function call: a frame from column 10 and row 5, 20 wide and 8 high."
    },
    {
      "id": "u16",
      "kind": "call",
      "call": "color(LIGHT_GREEN)"
    },
    {
      "id": "u17",
      "kind": "call",
      "call": "frame(4, 15, 32, 4)"
    },
    {
      "id": "u18",
      "kind": "call",
      "call": "color(LIGHT_BLUE)"
    },
    {
      "id": "u19",
      "kind": "call",
      "call": "frame(32, 0, 6, 6)"
    },
    {
      "id": "u20",
      "kind": "call",
      "call": "color(WHITE)"
    },
    {
      "id": "u21",
      "kind": "call",
      "call": "at(12, 9)"
    },
    {
      "id": "u22",
      "kind": "output",
      "values": "\"Tokbit draws\"",
      "newline": false
    },
    {
      "id": "u23",
      "kind": "call",
      "call": "at(0, 20)"
    }
  ],
  "functions": [
    {
      "name": "frame",
      "params": [
        {
          "name": "x",
          "type": "int"
        },
        {
          "name": "y",
          "type": "int"
        },
        {
          "name": "width",
          "type": "int"
        },
        {
          "name": "height",
          "type": "int"
        }
      ],
      "returnType": null,
      "blocks": [
        {
          "id": "u1",
          "kind": "for",
          "variable": "i",
          "range": "width",
          "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 + height - 1)"
            },
            {
              "id": "u5",
              "kind": "output",
              "values": "\"#\"",
              "newline": false
            }
          ]
        },
        {
          "id": "u6",
          "kind": "for",
          "variable": "j",
          "range": "height",
          "body": [
            {
              "id": "u7",
              "kind": "call",
              "call": "at(x, y + j)"
            },
            {
              "id": "u8",
              "kind": "output",
              "values": "\"#\"",
              "newline": false
            },
            {
              "id": "u9",
              "kind": "call",
              "call": "at(x + width - 1, y + j)"
            },
            {
              "id": "u10",
              "kind": "output",
              "values": "\"#\"",
              "newline": false
            }
          ]
        }
      ],
      "comment": "A frame at x, y of the given width and height: top and bottom, then the sides."
    }
  ],
  "comment": "Solution to the task “A third frame”: Draw a third frame: a 6 × 6 square in the top right corner, in another colour. Don’t change the function, just call it."
}
