Files
funk/tests/test.funk

32 lines
799 B
Plaintext
Raw Normal View History

2025-10-25 21:28:16 +11:00
dingus func {
2025-10-26 20:44:47 +11:00
// println is an inbuilt function, you can also use print
2025-10-25 21:28:16 +11:00
println("you got dingused")
2025-10-26 20:44:47 +11:00
// 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
2025-10-25 21:28:16 +11:00
if (true) {
println("yay")
}
2025-10-26 20:44:47 +11:00
// types available are int, float, string, bool
2025-10-25 21:28:16 +11:00
println(321)
2025-10-26 20:44:47 +11:00
println(3.14)
println("I am a string!")
println(true)
2025-10-25 21:28:16 +11:00
}
2025-10-26 20:44:47 +11:00
// main is the entry point of the program, like many other languages
2025-10-25 21:28:16 +11:00
main func {
2025-10-26 20:44:47 +11:00
// call a function (with arguments!)
dingus("hehe")
2025-10-25 21:28:16 +11:00
}
2025-10-26 20:44:47 +11:00
// run this if you dare! try adding it in the main function!
2025-10-25 21:28:16 +11:00
infinity func {
while (true) {
println("to infinity and beyond!")
}
}