Jump to content

Loop structures: Difference between revisions

Added Toka
No edit summary
(Added Toka)
Line 878:
puts [incr i]
}
 
==[[Toka]]==
[[Category:Toka]]
 
=== iterate ===
Counts down, executing a quote until the counter reaches 0.
 
10 [ i . ] iterate
 
=== +iterate ===
Counts up, executing a quote until the counter reaches the requested count.
 
10 [ i . ] +iterate
 
=== whileTrue ===
Repeatedly executes a quote until the quote returns true.
 
100 [ dup . 1- dup 0 <> ] whileTrue
 
=== whileFalse ===
Repeatedly executes a quote until the quote returns true.
 
0 [ dup . 1+ dup 101 = ] whileFalse
 
==[[UNIX Shell]]==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.