print, println, input, ground tutorial

This commit is contained in:
2025-09-20 12:08:20 +10:00
parent 2fd344af82
commit cc896629f7
3 changed files with 360 additions and 8 deletions

View File

@@ -84,23 +84,23 @@ Usage: `end $intvalue`
### I/O
#### stdin
#### input (or stdin)
Allows input from the console.
Usage: `stdin &var`
Usage: `input &var`
#### stdout
#### print (or stdout)
Allows output to the console.
Usage: `stdout $value`
Usage: `print $value`
#### stdlnout
#### println (or stdlnout)
Allows output to the console, appending a new line at the end.
Usage: `stdlnout $value`
Usage: `println $value`
### Variables and Lists
@@ -254,7 +254,7 @@ Some symbols specific to this category:
* `-type`: A type reference. Can be one of the following: "-string", "-char", "-int", "-double", "-bool"
#### fun
#### fun
Defines a function. All code between `fun` and `endfun` will be included in the function.
@@ -290,7 +290,7 @@ Usage: `call !function &var
#### use (Experimental, please report bugs!)
Attempts to import another Ground program. Gets inserted wherever the use statement is. Any code (including code outside function declarations) will be executed. All functions from the library will be given a prefix, meaning functions will be registered as `!libName:functionName`.
Attempts to import another Ground program. Gets inserted wherever the use statement is. Any code (including code outside function declarations) will be executed. All functions from the library will be given a prefix, meaning functions will be registered as `!libName:functionName`.
Note: Ground will check the directory where the program is being run from when trying to find imported programs. If that fails, it will check the directory set in the $GROUND_LIBS environment variable set by your system. The '.grnd' extension is appended automatically.