1
0
Fork 0
forked from fun/fun

Just playing and having fun...

This commit is contained in:
Johannes Findeisen 2025-09-19 10:32:24 +02:00
commit 1058cefc7a

View file

@ -15,16 +15,51 @@ fun foo()
print("Yay, the playground for having fun... ;)")
number n = 10
number n = 23
print(n)
n = "foobar"
// This must fail because n is of type number and can not become a string or function. Setting it to 0 is not an option.
n = "FooBar"
print(n)
n = 100
print(n)
print("Typeof n: " + typeof(n))
fun n()
print("n")
n()
// Typeof n must be of type function here... Not Sint64.
print("Typeof n: " + typeof(n))
n = 2342
print(n)
print("Typeof n: " + typeof(n))
x = 42
print (x)
x = "BarFoo"
print(x)
// Arrays must be declared with an "array" identifier if not beeing dynamicly typed. We need the "array" type."
a = [23, 42]
print(a)
print(a[0])
// Why this is possible? Seting n to a string, sets n to 0. Setting an array to 1 works...? This must fail when an a is of type "array", not in this case!
a = 1
print(a)
string s = 'Have\n"fun!"'
print(s)
print("\'" + " Fun")
print('\'' + " \'Fun\'")
print('\'' + " \"Fun\"")
print('\'' + " \n\"Fun\"")
print('\'' + " \n\t\"Fun\"")
print("Running foo()...")
foo()