1/17
Comprehensive vocabulary flashcards covering while loops, do-while loops, loop structure, compiler errors, and debugging concepts for C# and Unity.
while loop
A loop that repeats its body while the condition is true and checks the condition before running the body.
do-while loop
A loop that runs its body first, then checks the condition. Its last line is } while (condition);
condition
The true or false question located inside the parentheses after while.
set, check, change
The three essential components of a loop: a starting value set before the loop, the condition that checks/reads it, and the update line that changes it.
update line
The line inside the loop body that modifies the value that the condition reads.
pass
One complete execution or run of the loop body.
check
One evaluation of the loop condition; if true, the body runs; if false, the loop ends.
zero-pass case
A while loop whose condition evaluates to false the very first time, resulting in the body executing 0 times.
one-pass minimum
The operational rule that a do-while loop always executes its body at least 1 time before checking the condition.
infinite loop
A loop that never terminates, causing the Unity editor to freeze; in class projects, the visualizer halts it at 200 passes and displays NEVER ENDED.
guard
A second test joined to the loop condition with && (such as && guard < 5) that terminates the loop after a specified number of passes.
GUARD lamp
An indicator lamp in the visualizer that is lit when the guard terminates the loop and dark when the loop condition terminates it.
verdict
An if / else structure placed after a loop that reports why the loop stopped executing.
Random.Range(1, 7)
A Unity C# method that returns 1, 2, 3, 4, 5, or 6; the upper boundary number never comes out.
Warning CS0642
A yellow compiler warning generated when a semicolon is accidentally placed directly after while (condition); which can cause Unity to freeze.
Error CS1002
A red compiler error stating '; expected', caused by omitting the required semicolon at the end of a do-while statement: } while (condition);
Error CS0103
A red compiler error triggered when a loop counter variable is declared inside the body (e.g., int count = 0;) rather than before the loop.
LoopVisualizer.Pass(…)
A visualizer method that must be placed inside the loop body as the last line, rather than outside after the closing brace.