How to use the Code Trace Tutor.
A code trace should track variable values in execution order. Use the actual language semantics and a small explicit input.
Make the workflow fit your task.
Use a small explicit input and track variable values after each executed statement. Respect the language's evaluation order and distinguish the program's printed output from its internal final state.
- What you provide
- Small program and given inputs.
- What you get
- Explained execution trace for learning.
See the input and the result.
Illustrative input and output · a teaching example, not a live WebAct run
Example input
Python: total = 0; then add each value in [2, 3] to total.
Completed example
Initial total 0; after 2, total 2; after 3, total 5. Final value: 5.
Load this input into the prompt, then copy it to WebAct to try the task. Your result may differ from the illustration.
Decisions and troubleshooting.
Should a code trace skip iterations that seem repetitive?
Show enough iterations to establish the state changes, including boundaries. Repetition can conceal the step where an off-by-one error appears.
Why does the trace disagree with the program's actual output?
Check language semantics, input types and execution order, then run the small example in the stated runtime where available.
Try it with your own source.
Replace the example with your material in the task prompt. Keep the requirements you need, then copy the task into WebAct.
Customize and copy the task ↑