{
  "format": "tokbit",
  "version": 1,
  "name": "Melody twice as fast",
  "main": [
    {
      "id": "u1",
      "kind": "output",
      "values": "\"Ode to Joy (Beethoven)\""
    },
    {
      "id": "u2",
      "kind": "declare",
      "name": "notes",
      "type": "list[str]",
      "init": "[\"E4\", \"E4\", \"F4\", \"G4\", \"G4\", \"F4\", \"E4\", \"D4\", \"C4\", \"C4\", \"D4\", \"E4\", \"E4\", \"D4\", \"D4\", \"E4\", \"E4\", \"F4\", \"G4\", \"G4\", \"F4\", \"E4\", \"D4\", \"C4\", \"C4\", \"D4\", \"E4\", \"D4\", \"C4\", \"C4\"]"
    },
    {
      "id": "u3",
      "kind": "declare",
      "name": "lengths",
      "type": "list[int]",
      "init": "[400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 600, 200, 800, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 600, 200, 800]"
    },
    {
      "id": "u4",
      "kind": "for",
      "variable": "i",
      "range": "len(notes)",
      "body": [
        {
          "id": "u5",
          "kind": "output",
          "values": "notes[i] + \" \"",
          "newline": false
        },
        {
          "id": "u6",
          "kind": "call",
          "call": "note(notes[i], lengths[i] // 2)"
        }
      ],
      "comment": "The same index i picks both the note and its length; // 2 halves it."
    },
    {
      "id": "u7",
      "kind": "output",
      "values": "\"\""
    }
  ],
  "functions": [],
  "comment": "Solution to the task “Twice as fast”: Play the tune twice as fast without rewriting the list of lengths."
}
