From 042db745da93311f1ef02c0d232c39a08446d8b3 Mon Sep 17 00:00:00 2001 From: Suleyman Farajli Date: Fri, 3 Jan 2025 00:39:09 +0400 Subject: new examples added --- examples/const.gorth | 4 ++++ examples/hello_world.gorth | 5 +++++ examples/words.gorth | 7 +++++++ 3 files changed, 16 insertions(+) create mode 100644 examples/const.gorth create mode 100644 examples/hello_world.gorth create mode 100644 examples/words.gorth (limited to 'examples') 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 -- cgit v1.2.3