BASICS


As the name describes, SCCOL is a command-oriented language, meaning that the core base of it is executing commands and their arguments. Commands here are used to do pretty much everything - from displaying text on screen to writing complex programs and algorithms.


Syntax

Because the language is command-oriented, the syntax isn't very complex. Most commands may require additional arguments that are separated by spaces. In the command info they are lowercase and are surrounded by either braces {}, or parentheses (). When an argument is surrounded with braces, that means it is a required argument and the command won't be executed without you specifying it. When an argument is surrounded with parentheses, that means it is optional and the command can be executed without it.

Each command can be executed as a single command, or in an algorithm of ones. When executing in an algorithm, all commands should be separated with semicolons (;). A semicolon can be put at the end of the command when executing as a single one, but it is optional.

Here you can see that entering and submitting a single command doesn't require a semicolon:

SAY Hello, World!

Output:

Hello, World!

If we wan't to include a semicolon in our string we can do that using either \; or ||SEMICOLON||:

SAY ||SEMICOLON||Hello, World!\;

Output:

;Hello, World!;

Memory buffer

In SCCOL there are no variables. Instead, there are memory buffer blocks. They can store a real number or a string and can be accessed at any time. They can't have a callable name, instead they are numbered and their value can be passed via the %^ prefix.

For example, here is a piece of code that assigns to the memory buffer block 0 and then displays its value:

SET 0 Block 0; // This sets block 0 to a string "Block 0"; SAY %^0; // Displays block 0's value;

Output:

Block 0

The %^ prefix can also be used to get a predefined global variable/constant (for example: %^PI will return 3.141592653589793). For the list of all available variables look here.


Operators

To do mathematical calculations and use the IF command there exist certain operators and certain rules in using them. They can be used anywhere when specifying a value and are compiled before commands. For the complete list of available operators look here.

All of the operators are called using the $ symbol as a prefix and must be surrounded by parentheses. While it is possible to do multiple calculations at a time, it is not recommended, as there is a specific order in which they are compiled.

Let's say we need to get the value of 65 * π / 180. In SCCOL it would look like this:

SET 0 (65 $* %^PI); // Though you should use %^D2R to convert degrees to radians; SAY (%^0 $/ 180);

Output:

1.1344640137963142

So there were two operations done here, 65 was multiplied by a predefined global constant PI and set to memory buffer block 0 and then memory buffer block 0's value (65 * π) was divided by 180 in the SAY command execution.


Procedures

For executing the same commands over and over there exist procedures. You can declare them using the PROC and END commands. The PROC command will require a name for the procedure that can later be used as an identifier to call it using the CALL command.

Here is an example of using procedures:

SET 0 0; PROC MAIN; SAY %^0; SET 0 (%^0$+1); IF (%^0$<5) CALL MAIN; END; CALL MAIN;

Output:

0 1 2 3 4

Value "types"

There aren't any defined value types in SCCOL, but essentially, all of them split into real numbers (REAL) and strings (STR). When an argument requires a string, most of the time a real number can be passed without issues. There are also some types like INT, COMMAND, EXPRESSION, PROCEDURE, but for most of them they just check the memory for definitions.