From a76977af62010a392c16010c367185e61e856ffe Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Wed, 30 Oct 2019 20:04:56 +0100 Subject: mv to docs --- docs/buzzard/demo3.th | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 docs/buzzard/demo3.th (limited to 'docs/buzzard/demo3.th') diff --git a/docs/buzzard/demo3.th b/docs/buzzard/demo3.th new file mode 100644 index 0000000..c061b74 --- /dev/null +++ b/docs/buzzard/demo3.th @@ -0,0 +1,15 @@ +: printfour + + dup ( save the number on top of the stack ) + 4 = ( compare it to four ) + if + " forth " ( output a string for it ) + drop ( and delete the saved value ) + else + . + endif +; + +: demo3 10 0 do i printfour loop cr ; + +demo3 -- cgit v1.2.3