diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2020-06-03 10:50:20 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2020-06-03 11:04:00 +0000 |
| commit | 4b8a0f024606ca8c602a4e886767d414995ca0a2 (patch) | |
| tree | 0477d875efed4bc495827ccf265c1bb44397ce4e /docs/guide/02_hello-world.md | |
| parent | add loop/recur (diff) | |
| download | alive-4b8a0f024606ca8c602a4e886767d414995ca0a2.tar.gz alive-4b8a0f024606ca8c602a4e886767d414995ca0a2.zip | |
split guide into guide and reference
Diffstat (limited to 'docs/guide/02_hello-world.md')
| -rw-r--r-- | docs/guide/02_hello-world.md | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/docs/guide/02_hello-world.md b/docs/guide/02_hello-world.md new file mode 100644 index 0000000..7f1517d --- /dev/null +++ b/docs/guide/02_hello-world.md @@ -0,0 +1,33 @@ +Before getting into all the details of the `alv` language, let's quickly run an +example program to make sure that everything is working correctly: + + ([1]import* time) + ([2]print ([3]every 0.5 "hello world!")) + +Open a text file save this piece of code as `hello.alv`. You can also find this +example program in the repository and the windows binary package. + +As mentioned earlier, there are two different ways to run `alv` programs: using +the copilot GUI, or in the terminal. + +## starting the copilot GUI +On Linux and Mac OS X, you can launch the GUI by executing the `alv-fltk` +command. On Windows, you can double-click `alv-fltk.bat`. This window should +open: + + + +Now open `hello.alv` using `File > Open Script` or the shortcut `^O` +(control-O). The copilot should start printing `hello world` over and over +again in the lower field. + +You can pause and resume execution using the `Run` button or the `^P` shortcut. +To stop the program simply close the window. + +## starting the copilot in the terminal +To run a file in the terminal, invoke the command `alv <path/to/hello.alv>`. If +your system cannot find the `alv` command, check your installation and `PATH`. +On Windows, it is also possible to drag your `alv` file onto `alv.bat`. + +You should now see the text `hello world` being printed over and over again, +twice a second. You can stop the copilot by pressing `^C` (control-C). |
