Hello World!
Now that you have installed Blizzard, let's write your first Blizzard program. Tradition is to write a program that outputs Hello World!
to the console, so we will setup a Blizzard project and create a hello world program here.
Making the directories
First we should create a directory (folder) on your computer where you can keep all your programs. It doesn't matter where you create this, but for this tutorial, we will place it in the home directory.
- Navigate to your home directory. This is
C:\Users\<you>\
on Windows,~/
on Linux and Mac. - Create a new directory for your projects. We will call this
projects
.
When writing Blizzard code, it is best to separate each project into its own directory. This makes it harder to accidentally use code from other files that you shouldn't, which we will discuss later on. Let's create a new directory called hello_world
.
Now we are all ready to write some code!
Writing your first Blizzard program
- Open the
hello_world
folder in VSCode. - Create a new file called
main.bzz
. Blizzard Source Files always have the file extension.bzz
. - Write the following code into the file you just created.
WRITELN("Hello World!");
- Open a terminal in the current directory. In VSCode you can click Terminal > New Terminal.
- Run the command
Blizzard run main.bzz
. You should see the wordsHello World!
on screen.
🎉 Congratulations! You have just written your first Blizzard program!
Things to Remember
- Blizzard Source Files always have the file extension
.bzz
- We can use the
WRITELN
function to show text on the screen