diff options
| author | Paul Buetow <paul@buetow.org> | 2009-10-30 14:54:34 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2009-10-30 14:54:34 +0000 |
| commit | 1542ff3a3927916c23dabffff9533b58f63f4b54 (patch) | |
| tree | 4a34357fc9723d4f65daa3b5a5de4099bcfd7424 /examples/variables.fy | |
| parent | 9eb12638e152d981492382cb534edb89a8625990 (diff) | |
| parent | 1bc73e78278b630768723869d277d05404feae03 (diff) | |
Diffstat (limited to 'examples/variables.fy')
| -rw-r--r-- | examples/variables.fy | 21 |
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; |
