Anatomy of a script
A script in AddyScript is a sequence of statements in any order. Even an empty file is a valid script. Statements come in many different forms: import directives, class or function definitions, tests, loops, blocks, assignments, try-catch-finally structures, etc.... There is no particular order in which you should organize your statements. For example, you might assign a value to a variable, then declare a class, and then call a function. Some statements are elementary, while others may contain child statements. We will learn about the different types of statements and the proper syntax for each as we progress through this manual. Here are some sample scripts to get you started:
Simply printing "Hello World!" to the standard output:
| Hello World | |
|---|---|
Reading n from the standard input and computing the sum and average of n numbers:
| Sum and average of n numbers | |
|---|---|
Declaring a function to say "Hello" to each name in a list:
Well, now you can try your own.