Tutorial Hello

From Monster Wiki

Jump to: navigation, search

Prerequisites

This is the first of a series of tutorials for using the Monster scripting language. If you need help installing Monster, see the Installation Guide. If you're looking for help on integrating Monster into your project, check out the API Tutorials.

Say Hello!

Open a file called 'hello.mn' and copy/paste the following text:

import io;                        // Make output functions available
 
writeln("Hello Monster world!");  // Output

Save the file and run it on the command line with the mvm command:

mvm hello.mn

Output:

Hello Monster world!

If you get a command not found error or similar when running mvm, make sure you've followed all the steps in the Installation Guide.

This is how we'll be running all the basic tutorial examples. Of course, later on you'll most likely want to run the scripts from inside your own program, instead of using the external 'mvm' program. We'll teach you how to do this in the API Tutorials.

Next up, a look at comments.