{
  "format": "tokbit",
  "version": 1,
  "name": "Hádej číslo se 7 pokusy",
  "main": [
    {
      "id": "hc1",
      "kind": "declare",
      "name": "tajne",
      "type": "int",
      "init": "randint(1, 100)"
    },
    {
      "id": "hc2",
      "kind": "declare",
      "name": "tip",
      "type": "int",
      "init": "0"
    },
    {
      "id": "hc3",
      "kind": "declare",
      "name": "pokusy",
      "type": "int",
      "init": "0"
    },
    {
      "id": "hc4",
      "kind": "output",
      "values": "\"Myslím si číslo od 1 do 100.\""
    },
    {
      "id": "hc11",
      "kind": "while",
      "condition": "tip != tajne and pokusy < 7",
      "body": [
        {
          "id": "hc5",
          "kind": "input",
          "target": "tip",
          "prompt": "Tvůj tip:"
        },
        {
          "id": "hc6",
          "kind": "assign",
          "target": "pokusy",
          "value": "pokusy + 1"
        },
        {
          "id": "hc10",
          "kind": "if",
          "condition": "tip < tajne",
          "then": [
            {
              "id": "hc7",
              "kind": "output",
              "values": "\"Víc.\""
            }
          ],
          "else": [
            {
              "id": "hc9",
              "kind": "if",
              "condition": "tip > tajne",
              "then": [
                {
                  "id": "hc8",
                  "kind": "output",
                  "values": "\"Míň.\""
                }
              ],
              "else": []
            }
          ]
        }
      ],
      "comment": "Opakuje se, dokud tip není správný a zbývají pokusy."
    },
    {
      "id": "hc13",
      "kind": "if",
      "condition": "tip == tajne",
      "then": [
        {
          "id": "hc12",
          "kind": "output",
          "values": "\"Uhodl jsi! Počet pokusů:\", pokusy"
        }
      ],
      "else": [
        {
          "id": "hc14",
          "kind": "output",
          "values": "\"Došly ti pokusy. Myslel jsem si:\", tajne"
        }
      ]
    }
  ],
  "functions": [],
  "comment": "Hádej číslo, ale nejvýš 7 pokusů. Řešení úkolu z hodiny s Tokbitem.",
  "screen": "fit"
}
