dozens.forth
commit
e67fe553e2
|
@ -0,0 +1,28 @@
|
|||
# Dozens
|
||||
|
||||
how many dozens?
|
||||
|
||||
## About
|
||||
|
||||
This document is a valid literate style retro forth program. You can execute it with `retro dozens.md`, or include it in a file or in the repl with `'dozens.md include`.
|
||||
|
||||
## Contents
|
||||
|
||||
~~~
|
||||
:dozens (n-n) #12 * ;
|
||||
~~~
|
||||
|
||||
That's it. That's the whole thing.
|
||||
|
||||
## Testing
|
||||
|
||||
Run the test with `retro -t Dozens.forth`:
|
||||
|
||||
```
|
||||
'GROSS_CHECK s:put nl
|
||||
'12_dozens_should_be_144 s:put nl
|
||||
|
||||
#12 dozens
|
||||
dup #144 eq? [ 'PASS s:put ] [ 'FAIL s:put ] choose
|
||||
sp n:put
|
||||
```
|
Loading…
Reference in New Issue