demo of nested loop
This commit is contained in:
+15
@@ -3,3 +3,18 @@
|
||||
|
||||
: test2 begin 1 - dup . dup 0= until ;
|
||||
10 test2
|
||||
|
||||
: test3
|
||||
dup .
|
||||
begin
|
||||
1 - dup
|
||||
|
||||
." ( "
|
||||
5 begin dup while 1 - dup . repeat
|
||||
." ) " drop
|
||||
|
||||
.
|
||||
dup 0=
|
||||
until ;
|
||||
|
||||
3 test3
|
||||
|
||||
Reference in New Issue
Block a user