Route The Scripting Language
>ABOUT Route is a dynamic, high-level, procedural scripting language inspired by languages like BASIC, Lua, and Python. Route emphasises instructions that are both easy to read and interpret. |
---|
>SYNTAX Route's syntax is very similar to BASIC, but its expressions are very simplified and only perform one operation at a time. This creates a consistant, clean structure between all Route scripts and creates more variables you can use later. Route does not require whitespace for block layers, however it is recommended for readability. Route avoids abstract symbols like parenthesis or brackets, and relies on spaces and consistant command structure to separate tokens. |
---|
>QUIRKS Scope does not exist in Route, so all variables are 'global'. Subroutines do not accept parameters. Integers and floats are simplified into one NUM type. Variables are passed by reference, but can be passed by value using the VAL command. |
---|
>FLOW The name Route represents your program's 'flow of control', or the 'path' along the script's execution. Route features the GOTO statement, allowing you to control the flow manually by jumping from one line to another. GOTO can send the flow to a line number, or a user defined label called a MARKER. Route also supports subroutines, defined with the BLOCK statement. Blocks act like markers but end with a RETURN statement that returns the flow of control to the GOTO statement which called it. |
---|
>KEYWORDS The following keywords are reserved with built in functionality and should not be used as variable names. IF THEN END MARKER BLOCK RETURN WHILE DO TRUE FALSE LIST NUM ASK INDEX VAL LEN PRINT GOTO ADD REMOVE |
---|
>IF STATEMENTS There are two forms of if statements in Route. Single-line if statements and multi-line 'block' if-then statements. |
---|
SINGLE-LINE IF STATEMENT EXAMPLE fruit = "apple" IF fruit == "apple" PRINT "Fruit does equal apple!" PRINT "This prints regardless of fruits value." MULTI-LINE IF STATEMENT EXAMPLE fruit = "apple" IF fruit == "apple" THEN PRINT "Fruit does equal apple!" PRINT "This only prints if fruit equals apple!" END PRINT "This prints regardless of fruits value." |
---|
>USER INPUT The ASK command is used to take a line of user input from the console. It takes one parameter, a string that will be printed to the console. |
---|
ASK EXAMPLE name = ASK "Enter your name: " PRINT "Welcome to Route, " PRINT name |
---|
>MATH OPERATORS Math operations are written in the form "variable sign= parameter" where the parameter will be applied to the variable using the sign. |
---|
MATH EXAMPLE number = 10 number += 1 PRINT number number -= 1 PRINT number number *= 2 PRINT number number /= 2 PRINT number |
---|
>STRING CONCATENATION String concatenation reuses the += operator and combines two strings into one. |
---|
CONCATENATION EXAMPLE string = "MIKE" string2 = "JON" string += " AND " string += string2 PRINT string |
---|
>CASTING A STRING TO A NUMBER Strings can be casted to numbers using the NUM command, which takes one parameter that will be casted to an integer or float appropriately. |
---|
NUM EXAMPLE stringNumber = ASK "Enter any number: " number = NUM stringNumber |
---|
Published | 25 days ago |
Status | Released |
Category | Tool |
Platforms | HTML5 |
Author | Kyranok (Jordan Greydanus) |
Tags | basic, Commodore 64, javascript, js, language, lua, python, route, scripting |