From da312e375eb0a0758a4dd72e287d3aba86c04d99 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 10 Jun 2017 23:18:31 +0200 Subject: Add FIRST & THIRD almost FORTH --- buzzard/demo3.th | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 buzzard/demo3.th (limited to 'buzzard/demo3.th') diff --git a/buzzard/demo3.th b/buzzard/demo3.th new file mode 100644 index 0000000..c061b74 --- /dev/null +++ b/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