summaryrefslogtreecommitdiff
path: root/examples/variables.fy
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-08-26 08:17:55 +0000
committerPaul Buetow <paul@buetow.org>2008-08-26 08:17:55 +0000
commit9bf07e1dfa69b5d6e4c296c0690b5ed91f909b7b (patch)
tree60f46be65a1fbaeed2f5deb1d4dbcf5ea68e0d01 /examples/variables.fy
added v0.1 branch
Diffstat (limited to 'examples/variables.fy')
-rw-r--r--examples/variables.fy21
1 files changed, 21 insertions, 0 deletions
diff --git a/examples/variables.fy b/examples/variables.fy
new file mode 100644
index 0000000..ac619c9
--- /dev/null
+++ b/examples/variables.fy
@@ -0,0 +1,21 @@
+#*
+ * Examples of how to define variables
+ *#
+
+# Defines the variables
+my foo = 1 + 1;
+my bar = 4 - 1, baz = 100 + 1, bay;
+
+# bay has been initialized with the default value of 0
+say bay;
+
+# Prints out "5\n"
+assert 5 == (say foo + bar);
+
+# Pritns out "51101\n"
+assert 51 == (put baz - 50);
+assert 101 == (say baz);
+
+# Change the value of the variable to 99 and print it out
+assert 99 == (baz = 99);
+say baz;