diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/const.gorth | 4 | ||||
-rw-r--r-- | examples/hello_world.gorth | 5 | ||||
-rw-r--r-- | examples/words.gorth | 7 |
3 files changed, 16 insertions, 0 deletions
diff --git a/examples/const.gorth b/examples/const.gorth new file mode 100644 index 0000000..fce45b8 --- /dev/null +++ b/examples/const.gorth @@ -0,0 +1,4 @@ +# Prints out the value 5 + +const CON 5 +CON dump diff --git a/examples/hello_world.gorth b/examples/hello_world.gorth new file mode 100644 index 0000000..1df3bf4 --- /dev/null +++ b/examples/hello_world.gorth @@ -0,0 +1,5 @@ +# Prints out "Hello, World!" + +include "../lib/stdlib.gorth" + +"Hello, World!" write diff --git a/examples/words.gorth b/examples/words.gorth new file mode 100644 index 0000000..b88d20e --- /dev/null +++ b/examples/words.gorth @@ -0,0 +1,7 @@ +# Prints out one + +word printOutOne + 1 dump +end + +printOutOne |