Help with program memory for my GKC TUI

No. Essentially:
If I wanted to output the numbers from 1-10 I could:
print(1)
print(2)
print(3)
…until
print(10)
but instead of that repetitive coding, I can just make a loop:
for i in range(10):
print(i)
and that will output the numbers from 1-10.

It stores a number that needs to be increased in order to progress through the loop, a while loop illustrates that nicely:
while i < 11:
print(i)
i = i + 1

This will repeat the code over and over until the condition is met. You can do the same in gimkit creative:
set i to 0
if i < 11:
print(i)
i = i + 1
broadcast on “continue loop”
else:
broadcast on “end loop”

I hope this explains loops correctly…

Also check this out:

2 Likes