I think I have found a little bug in the increment section of the FOR loop.
This code works fine:
#!/usr/bin/env abs
# the first 100 terms of the fibonnaci sequence
t1 = 0 # first term
t2 = 1 # second term
max = 100 # max number of iterations
echo(t1)
echo(t2)
for counter = 0; counter < max; counter = counter + 1 {
t3 = t1 + t2
echo(t3)
t1 = t2
t2 = t3
}
But this version:
#!/usr/bin/env abs
# the first 100 terms of the fibonnaci sequence
t1 = 0 # first term
t2 = 1 # second term
max = 100 # max number of iterations
echo(t1)
echo(t2)
for counter = 0; counter < max; counter += 1 {
t3 = t1 + t2
echo(t3)
t1 = t2
t2 = t3
}
Gives me this error:
parser errors:
expected next token to be IDENT, got = instead
[13:5] t3 = t1 + t2
no prefix parse function for '=' found
[13:8] t3 = t1 + t2
no prefix parse function for '}' found
[17:1] }
Otherwise this is a nice little scripting language. Thanks
I think I have found a little bug in the increment section of the FOR loop. This code works fine:
But this version:
Gives me this error:
Otherwise this is a nice little scripting language. Thanks