Step runs the program line by line, for Python, C and C++. The panel under the console shows the call stack, the variables and the trace table.
#include <stdio.h>
int fact(int n)
{
if (n <= 1) {
return 1;
}
return n * fact(n - 1);
}
int main(void)
{
int n = 4;
int f = fact(n);
printf("%d! = %d\n", n, f);
return 0;
}
Student
- Click left of line 5 (the
if): a red dot, a breakpoint. Run stops there. - Step goes into
fact, Step over runs a call whole, Step out finishes the current call. - Call stack: the newest call on top; a click shows its variables. Auto step with the speed slider steps by itself.
- While stepping, rest the mouse on a variable in the code: the tooltip shows its value at the shown step.
Teacher
- Every runnable Python, C or C++ example has Step; nothing to set.
- On the projector, ask "what is on the stack now?" before every Step.