summaryrefslogtreecommitdiff
path: root/test.fy
diff options
context:
space:
mode:
Diffstat (limited to 'test.fy')
-rw-r--r--test.fy23
1 files changed, 23 insertions, 0 deletions
diff --git a/test.fy b/test.fy
new file mode 100644
index 0000000..4f9af9b
--- /dev/null
+++ b/test.fy
@@ -0,0 +1,23 @@
+#*
+ * Examples of how to use arrays
+ *#
+
+# Create a function bar, returns 0 by default
+func bar { say "bar" }
+
+# Create a multi dimensional array foo
+my foo = [bar, 1, 4/2, double "3", ["A", ["BA", "BB"]]];
+
+# Run on each element of foo recursive 'say'
+say foo;
+
+# Print the length of the array
+assert 5 == say len foo;
+
+# Print the last index of the array
+assert 4 == say ind foo;
+
+# Print the 3rd element of the array
+say foo[3];
+
+#say "bla";