Files
funk/tests/test.funk
2025-10-29 11:45:58 +00:00

37 lines
905 B
Plaintext

import("myLib")
dingus func {
// println is an inbuilt function, you can also use print
println("you got dingused")
// for now, args for functions are accessed with arg0, arg1, etc
print("You said: ")
println(arg0)
// set a variable, similar to Python
x = 5
println(x)
// if statements are pretty standard
if (true) {
println("yay")
}
// types available are int, float, string, bool
println(321)
println(3.14)
println("I am a string!")
println(true)
// access things from a library
println(myLib::someConstant)
myLib::dingle()
}
// main is the entry point of the program, like many other languages
main func {
// call a function (with arguments!)
dingus("hehe")
}
// run this if you dare! try adding it in the main function!
infinity func {
while (true) {
println("to infinity and beyond!")
}
}