Skip to content

Hello DonutScript!

Witherbear edited this page Mar 10, 2023 · 1 revision

You First Program

With all of you learned, you can create your first program!

Hello World

To create your first program, you will write this:

require donut

This is a library, a bundle of files that creates utility functions. Now, write the main function:

fun main():
end

Inside the main function, use the println function to print "Hello DonutScript!":

println("Hello DonutScript!")

Compile the file to JAR and run in command line:

donut java Hello.donut
java -jar Hello.jar

And boom! In the command line will appear "Hello DonutScript!"

Clone this wiki locally