{
  "canonVersion": "v3.0",
  "canonAuthority": "Katarzyna Kalina vel Kalinowska",
  "world": "world_y5",
  "worldName": "Syntax Station",
  "yearGroup": 5,
  "theme": "Loops & Variables",
  "totalMissions": 16,
  "prerequisite": "gm_y4_final_01",
  "alignmentTable": [
    { "workbookMission": 1,  "gameMission": "gm_y5_explore_01",  "type": "EXPLORE",  "topic": "Welcome to Syntax Station",        "xp": 80  },
    { "workbookMission": 2,  "gameMission": "gm_y5_concept_01",  "type": "CONCEPT",  "topic": "Advanced FOR Loops",              "xp": 110 },
    { "workbookMission": 3,  "gameMission": "gm_y5_concept_02",  "type": "CONCEPT",  "topic": "FOR Loop with Accumulator",       "xp": 120 },
    { "workbookMission": 4,  "gameMission": "gm_y5_logic_01",    "type": "LOGIC",    "topic": "Advanced WHILE Loops",            "xp": 130 },
    { "workbookMission": 5,  "gameMission": "gm_y5_coding_01",   "type": "CODING",   "topic": "break and continue",              "xp": 140 },
    { "workbookMission": 6,  "gameMission": "gm_y5_concept_03",  "type": "CONCEPT",  "topic": "Lists — Store Multiple Values",   "xp": 130 },
    { "workbookMission": 7,  "gameMission": "gm_y5_logic_02",    "type": "LOGIC",    "topic": "List Methods and Slicing",        "xp": 140 },
    { "workbookMission": 8,  "gameMission": "gm_y5_coding_02",   "type": "CODING",   "topic": "Nested Loops",                    "xp": 160 },
    { "workbookMission": 9,  "gameMission": "gm_y5_coding_03",   "type": "CODING",   "topic": "Loops and Lists Together",        "xp": 160 },
    { "workbookMission": 10, "gameMission": "gm_y5_final_01",    "type": "FINAL",    "topic": "FINAL QUEST — Power the Station!","xp": 500 }
  ],
  "missions": [
    { "id": "gm_y5_explore_01", "title": "Welcome to Syntax Station", "type": "EXPLORE", "xp": 80, "difficulty": "beginner",
      "objectives": ["Explore all 5 zones", "Collect 5 discovery tokens", "Meet Nova and Chip"],
      "hints": ["Syntax Station is where loops get powerful!", "5 zones to explore — each teaches a different skill!", "Nova will guide you through each zone!"],
      "novaScript": "Welcome to Syntax Station, Captain! Here loops become powerful and lists store everything!",
      "chipScript": "Systems online! 5 zones to explore. I'll mark each one on your map!" },
    { "id": "gm_y5_concept_01", "title": "Advanced FOR Loops", "type": "CONCEPT", "xp": 110, "difficulty": "intermediate",
      "starterCode": "for i in range(???, ???, ???):\n    print(i)",
      "objectives": ["Use range(start, stop, step)", "Print countdown from 10 to 1", "Create a triangle pattern"],
      "hints": ["range(1, 11) gives 1 to 10. range(10, 0, -1) counts down!", "The step can be negative for counting down!", "Use the loop variable i in calculations inside the loop."],
      "novaScript": "range(start, stop, step) — control exactly how your loop counts! Even backwards!",
      "chipScript": "range(10, 0, -1) counts 10, 9, 8... down to 1. The -1 is the step!" },
    { "id": "gm_y5_concept_02", "title": "FOR Loop with Accumulator", "type": "CONCEPT", "xp": 120, "difficulty": "intermediate",
      "starterCode": "total = 0\nfor i in range(1, 6):\n    total = total + i\nprint('Total:', total)",
      "objectives": ["Trace accumulator through 5 iterations", "Calculate sum of 1 to 100", "Find factorial of 5"],
      "hints": ["Always initialise the accumulator BEFORE the loop!", "For addition: start at 0. For multiplication: start at 1!", "Trace through manually — write down the value after each iteration."],
      "novaScript": "An accumulator collects values! Start at 0, add to it each time the loop runs!",
      "chipScript": "total = 0 BEFORE the loop. Then total = total + i INSIDE the loop. Simple!" },
    { "id": "gm_y5_logic_01", "title": "Advanced WHILE Loops", "type": "LOGIC", "xp": 130, "difficulty": "intermediate",
      "objectives": ["Trace WHILE loop with doubling", "Find first number divisible by 7 AND 11", "Choose FOR vs WHILE correctly"],
      "hints": ["WHILE loops are perfect when you don't know how many times to repeat!", "The condition is checked BEFORE each iteration.", "If the condition starts False, the loop never runs!"],
      "novaScript": "WHILE loops keep going while the condition is True! Perfect for unknown repetitions!",
      "chipScript": "Check: will this condition EVER become False? If not — infinite loop!" },
    { "id": "gm_y5_coding_01", "title": "break and continue", "type": "CODING", "xp": 140, "difficulty": "intermediate",
      "starterCode": "for i in range(10):\n    if i == 5:\n        break\n    print(i)",
      "objectives": ["Predict output of break code", "Predict output of continue code", "Use break to find first divisible number"],
      "hints": ["break: EXIT the loop immediately.", "continue: SKIP the rest of this iteration, go to next.", "break is useful for searching — stop when you find what you need!"],
      "novaScript": "break exits the loop! continue skips to the next iteration! Powerful tools!",
      "chipScript": "break = stop completely. continue = skip this one, keep going." },
    { "id": "gm_y5_concept_03", "title": "Lists — Store Multiple Values", "type": "CONCEPT", "xp": 130, "difficulty": "intermediate",
      "starterCode": "planets = ['Syntax World', 'Algorithm Alley', 'Syntax Station']\nprint(planets[0])\nprint(planets[-1])",
      "objectives": ["Access list items by index", "Use append, remove, insert", "Loop through a list"],
      "hints": ["Index starts at 0! First item is list[0], not list[1].", "Negative index: list[-1] is the LAST item!", "len(list) gives the number of items."],
      "novaScript": "A list stores MANY values! Like a variable that holds a whole collection!",
      "chipScript": "Index starts at 0! planets[0] is first, planets[-1] is last!" },
    { "id": "gm_y5_logic_02", "title": "List Methods and Slicing", "type": "LOGIC", "xp": 140, "difficulty": "intermediate",
      "objectives": ["Use list slicing correctly", "Apply sort, reverse, count, index", "Predict slicing results"],
      "hints": ["list[2:5] gives items at index 2, 3, 4 (not 5!)", "list[::-1] reverses the list!", "list[::2] gives every other item."],
      "novaScript": "Slicing gets a portion of a list! list[start:stop] — powerful and precise!",
      "chipScript": "list[2:5] = items at index 2, 3, 4. Stop is NOT included!" },
    { "id": "gm_y5_coding_02", "title": "Nested Loops", "type": "CODING", "xp": 160, "difficulty": "advanced",
      "starterCode": "for row in range(3):\n    for col in range(3):\n        print(row, col)",
      "objectives": ["Trace nested loop (9 iterations)", "Print 5×5 star grid", "Create multiplication table"],
      "hints": ["Total iterations = outer × inner. 3×3 = 9 total!", "The INNER loop runs completely for EACH outer iteration.", "Indentation is crucial — inner loop must be indented inside outer!"],
      "novaScript": "Nested loops — a loop inside a loop! Perfect for 2D patterns and grids!",
      "chipScript": "Total iterations = outer × inner. 5×5 grid = 25 iterations!" },
    { "id": "gm_y5_coding_03", "title": "Loops and Lists Together", "type": "CODING", "xp": 160, "difficulty": "advanced",
      "objectives": ["Build list of squares with loop", "Filter list to keep scores > 20", "Write complete grade system"],
      "hints": ["Start with empty list: squares = []", "Use .append() inside the loop to add items!", "Combine loops, lists, AND conditionals for powerful programs!"],
      "novaScript": "Loops + Lists = POWER! Build lists with loops, process lists with loops!",
      "chipScript": "squares = [] then squares.append(i*i) inside the loop. Simple!" },
    { "id": "gm_y5_final_01", "title": "FINAL QUEST — Power the Syntax Station!", "type": "FINAL", "xp": 500, "difficulty": "advanced",
      "parts": [
        {"part": 1, "title": "Fix Nested Loop Power Grid", "type": "DEBUG", "xp": 100},
        {"part": 2, "title": "Use Lists to Track Power Levels", "type": "CODING", "xp": 100},
        {"part": 3, "title": "Find Low-Power Zones", "type": "CODING", "xp": 100},
        {"part": 4, "title": "Create Pattern Generator", "type": "CREATIVE", "xp": 100},
        {"part": 5, "title": "Write Master Control Loop", "type": "CODING", "xp": 100}
      ],
      "hints": ["This is your greatest challenge yet — but you have ALL the skills!", "Break it into parts. Solve one part at a time.", "You've solved harder problems than this. Trust your skills!"],
      "novaScript": "SYNTAX STATION needs you! Use ALL your loop and list skills to restore power!",
      "chipScript": "Plan your approach. Check each section. You've got this! 🤖",
      "rewards": {"xp": 500, "badges": ["year_5_master", "syntax_station_champion"], "worldUnlock": "world_y6",
        "novaFinalMessage": "SYNTAX STATION IS POWERED UP! You are a true Captain! Debugging Dunes awaits!",
        "chipFinalMessage": "RANK UP! Debugging Dunes unlocked! See you there, Admiral! 🔬"} }
  ]
}
