demo of nested loop

master
Ondřej Hruška 3 years ago
parent 5dc19b88ed
commit 26c65655e1
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 15
      loops.forth

@ -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

Loading…
Cancel
Save