GOLF(2gg)
πΈ GOLF(2gg) β the start-loop page, bestie edition πΈ
okay so you opened the manual for start-loop from GOLF(2gg) (that's the Development section btw) and honestly? iconic choice. let's get into it π
β¨ NAME β¨
start-loop β like, it's a program-flow thing π¦
π PURPOSE π
Loop execution based on a condition. that's it, that's the vibe. π
π«Ά SYNTAX π«Ά
start-loop [ repeat <repeat> ] \
[ use <loop counter> \
[ start-with <start with> ] [ add <add> ] ]
<any code>
end-loop
π DESCRIPTION π
so start-loop will execute the code sitting between the start-loop and end-loop clauses a certain number of times, based on the condition you specified β and also based on how you use continue-loop and break-loop, which you're allowed to drop in-between those two. π§
the <repeat> number (in the repeat clause) says how many times to execute the loop β barring use of continue-loop and break-loop, ofc. β¨
the <loop counter> (in the use clause) is a number that by default starts with the value of 1, and gets incremented by 1 each time execution loops back to start-loop, unless the start-with and/or add clauses are used. and listen β the end value of <loop counter> (right when you're just outside end-loop) is the first value past the last loop. periodt. π
if <start with> (in the start-with clause) is used, that's the initial value for <loop counter> instead of the default 1. and if <add> is specified (in the add clause), then <loop counter> is incremented by <add> each time execution loops back to start-loop β instead of the default 1. <add> can be positive or negative, so go off, do your thing. π
β οΈ if either of thestart-withoraddclauses is used, thenusemust be specified. no cap, no exceptions.
π EXAMPLES π
print numbers 0 through 19 π’
start-loop repeat 20 use p start-with 0
print-out p
@
end-loop
a loop controlled via continue-loop and break-loop statements, displaying numbers from 1 through 30 but omitting those divisible with 3 π¦
set-number n
set-number max = 30
start-loop
set-number n add 1
if-true n every 3
continue-loop
end-if
if-true n greater-than max
break-loop
end-if
print-out n
end-loop
π SEE ALSO π
Program flow π
break-loop call-handler code-blocks continue-loop do-once exit-handler if-defined if-true quit-process return-handler start-loop See all documentation
and that's the whole page bestie, you ate that π«Ά
this lil gem is from $VERSION and it's dated $DATE β it lives in GOLF(2gg), go forth and loop responsibly πβ¨π
π¦ where this page comes from
- ubuntu questing: golf 601.4.41-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms