From e67fe553e2eed062df921685fd6f9bb49ed4b526 Mon Sep 17 00:00:00 2001 From: "Christopher P. Brown" Date: Wed, 7 Jul 2021 14:42:35 -0600 Subject: [PATCH] dozens.forth --- dozens.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 dozens.md diff --git a/dozens.md b/dozens.md new file mode 100644 index 0000000..e7f15d5 --- /dev/null +++ b/dozens.md @@ -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 +```