CARROTREVOLT LABS
INTERACTIVE STUDIES / 03

Code Lab C#

All labsC# concepts · ready for Unity
LEVEL 1 · SEQUENCE1 / 15

First block

    Program.cs
    0 INSTRUCTIONS

    Console

    Ready

    Scene

    DRONE (0, 0)

    Memory

    VARIABLES IN SCOPE

    Execution

    STEP 0
      CODE LAB · C#

      Write it. Run it. Watch it.

      You program a drone that builds with blocks. Every challenge has a ghost shape to build.

      1. Run (F5) first compiles the program: the compiler checks the whole code. If there is an error, nothing runs and the Console tells you the line and what is wrong.
      2. Step (F10) runs one line at a time. The yellow line is the next one to run. Conditions show how they are evaluated: i < 7 → 3 < 7 → true.
      3. Step Into (F11) follows the program inside a method you wrote; Step runs the whole call at once. Each call gets its own frame in Memory: the call stack.
      4. Memory shows each variable as a box with a type, a name and a value. Variables live inside a scope (the { } where they were created) and disappear when it ends.
      5. The × numbers next to the line numbers count how many times each line ran. Grey text at the end of a line shows what it did the last time.
      6. Click a line number to add a breakpoint: Run pauses there.

      Coordinates: the drone moves on an 8 × 8 grid. X goes Right, Z goes Forward and Y is up, as in Unity.

      This lab runs a focused subset of C# in the browser (variables, if, loops, methods, Console, Math). The drone API only exists here. Progress and code are saved in this browser.