From 180b6ab7c204ddf3a8aa2b9b022085e6a96ff99a Mon Sep 17 00:00:00 2001 From: Suleyman Farajli Date: Tue, 7 Jan 2025 02:24:19 +0400 Subject: program name changed to 'ash' --- examples/const.ash | 4 ++++ examples/const.gorth | 4 ---- examples/fib.ash | 16 ++++++++++++++++ examples/fib.gorth | 16 ---------------- examples/hello_world.ash | 5 +++++ examples/hello_world.gorth | 5 ----- examples/seq10.ash | 6 ++++++ examples/seq10.gorth | 6 ------ examples/words.ash | 7 +++++++ examples/words.gorth | 7 ------- 10 files changed, 38 insertions(+), 38 deletions(-) create mode 100644 examples/const.ash delete mode 100644 examples/const.gorth create mode 100644 examples/fib.ash delete mode 100644 examples/fib.gorth create mode 100644 examples/hello_world.ash delete mode 100644 examples/hello_world.gorth create mode 100644 examples/seq10.ash delete mode 100644 examples/seq10.gorth create mode 100644 examples/words.ash delete mode 100644 examples/words.gorth (limited to 'examples') diff --git a/examples/const.ash b/examples/const.ash new file mode 100644 index 0000000..421f7f5 --- /dev/null +++ b/examples/const.ash @@ -0,0 +1,4 @@ +# Prints out the value 5 + +define CON 5 end +CON dump diff --git a/examples/const.gorth b/examples/const.gorth deleted file mode 100644 index 421f7f5..0000000 --- a/examples/const.gorth +++ /dev/null @@ -1,4 +0,0 @@ -# Prints out the value 5 - -define CON 5 end -CON dump diff --git a/examples/fib.ash b/examples/fib.ash new file mode 100644 index 0000000..bf2b90d --- /dev/null +++ b/examples/fib.ash @@ -0,0 +1,16 @@ +# Print out given number of elements in the Fibonacci sequence, 46 is the max value +define fib + var lim push lim + var a 1 push a + var b 1 push b + pull lim while dup 0 > do + pull a dump + pull b dup + pull a + + push b + push a + 1 - + done +end + +10 fib diff --git a/examples/fib.gorth b/examples/fib.gorth deleted file mode 100644 index bf2b90d..0000000 --- a/examples/fib.gorth +++ /dev/null @@ -1,16 +0,0 @@ -# Print out given number of elements in the Fibonacci sequence, 46 is the max value -define fib - var lim push lim - var a 1 push a - var b 1 push b - pull lim while dup 0 > do - pull a dump - pull b dup - pull a - + push b - push a - 1 - - done -end - -10 fib diff --git a/examples/hello_world.ash b/examples/hello_world.ash new file mode 100644 index 0000000..a1c1d48 --- /dev/null +++ b/examples/hello_world.ash @@ -0,0 +1,5 @@ +# Prints out "Hello, World!" + +include "../lib/std.ash" + +"Hello, World!" write diff --git a/examples/hello_world.gorth b/examples/hello_world.gorth deleted file mode 100644 index 1df3bf4..0000000 --- a/examples/hello_world.gorth +++ /dev/null @@ -1,5 +0,0 @@ -# Prints out "Hello, World!" - -include "../lib/stdlib.gorth" - -"Hello, World!" write diff --git a/examples/seq10.ash b/examples/seq10.ash new file mode 100644 index 0000000..e73743e --- /dev/null +++ b/examples/seq10.ash @@ -0,0 +1,6 @@ +# Print out numbers from 1 to 10 + +1 while dup 11 < do + dup dump + 1 + +done diff --git a/examples/seq10.gorth b/examples/seq10.gorth deleted file mode 100644 index e73743e..0000000 --- a/examples/seq10.gorth +++ /dev/null @@ -1,6 +0,0 @@ -# Print out numbers from 1 to 10 - -1 while dup 11 < do - dup dump - 1 + -done diff --git a/examples/words.ash b/examples/words.ash new file mode 100644 index 0000000..c0e1461 --- /dev/null +++ b/examples/words.ash @@ -0,0 +1,7 @@ +# Prints out one + +define printOutOne + 1 dump +end + +printOutOne diff --git a/examples/words.gorth b/examples/words.gorth deleted file mode 100644 index c0e1461..0000000 --- a/examples/words.gorth +++ /dev/null @@ -1,7 +0,0 @@ -# Prints out one - -define printOutOne - 1 dump -end - -printOutOne -- cgit v1.2.3