A simple program breakdown

Artsy programs uses a three-part system to turn words into action: Declare, Prepare, and Print. It starts with declaring a set of variables, then performing sets of operations (or prepare statements) to transform the variables, and finally outputting them to the console using print statements.

artsy-program-structure.png

Declare Statements

Declares allow Artsy to recognize a variable. Here is the format of a declare statement:

# Note that any code line in Artsy must end in a semicolon (or ";" symbol)
# FORMAT: declare {variableName} as {type};

# Example Declare Statement
declare x as int;

Once the variable “x” is declared, the program can then recognize “x” later in the program. Consequently, any prepare or print statements that use the variable “x” must be preceded by declare statement with “x” in it.

Prepare Statements

Prepare statements allow Artsy to associate a value with a variable. They also allow Artsy to modify or reset values. While some follow special formats (e.g., action statements), most prepare statements start with the “let” keyword. Here is the format of a basic prepare statement:

# Again, all code lines must end in a semicolon (";")
# FORMAT: let {variableName} = {value / operation}

# Example Prepare Statements
let x = 10;
let y = 73 * 2 / 10;

Print Statements

Printing is the final type of code line that allows the value of a variable to appear in the console. There are multiple ways to utilize print statement, however, a basic program will use print statements in the following format:

# Make sure to end code lines in a semicolon (";")
# Note that printing values and operations directly with this line are a WIP
# FORMAT: print {variableName};

# Example Print Statements
print "Hello, Artsy!"
print x;
print 10;
print 103 * 29;

Return to Homepage

Artsy Coding