Refactoring for OOP

This commit is contained in:
2025-10-26 20:44:47 +11:00
parent 191410d174
commit 81f836bc94
3 changed files with 112 additions and 39 deletions

View File

@@ -1,17 +1,30 @@
import("io")
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)
}
// main is the entry point of the program, like many other languages
main func {
dingus()
// 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!")