Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,22 @@
doc{
A couple of helper functions to make the rest of the
code more readable.
}doc
: rand ( -n ) random 20 mod ;
: . ( n- ) putn space ;
doc{
One approach is to use a simple repeat/again loop, and
a conditional exit. For instance:
}doc
: foo ( - )
repeat rand dup . 10 = if; rand . again ;
doc{
The other approach uses a structured while loop with the
second printing handled by a conditional clause.
}doc
[ rand dup . 10 <> [ [ rand . ] ifTrue ] sip ] while