forth/tutorial.fs

14 lines
182 B
Forth
Raw Normal View History

2022-02-08 13:14:44 +00:00
: min1
2dup 2dup > rot rot < rot swap or rot rot or and ;
: min2
2dup > 1+ roll nip ;
\ ... or is it "<"?
: gcd
2dup < if swap then
begin
tuck mod dup 0=
until
drop ;