Skip to content

Latest commit

 

History

History
49 lines (44 loc) · 2.03 KB

1.2.0.md

File metadata and controls

49 lines (44 loc) · 2.03 KB

OAT v1.2.0 Documentation

Changes

  • You can now add comments after code instead of on its own line
  • You can now have spaces in strings

Variables

dec var_name var_value - auto declares a variable
strdec - declares a string, a must for concatenation
intdec - declares an integer
chardec - declares a char
floatdec - declares a float
doubledec - declares a double
booldec - declares a boolean
mov a b - copies the value of a into b
def temp_var_name - creates a temp value so that functions that use two arguments can send to a variable, like pow
conv 76 double - converts a into b and places it into DEF. Uses static_cast(x)
fconv a b - converts a into a float and then places it in b. works on strings
dconv a b - converts a into a double and then places it in b. works on strings

Math

cat a b - adds two strings together. converts b into a string
add a b - adds a and b and stores it in a
sub a b - subtracts b from a and stores it in a
mul a b - multiplies a and b and stores it in a
div a b - divides a and b and stores it in a
mod a b - gets the modulus of a and b and stores it in a
pow a b - gets the power of a and b and stores them in DEF or a custom def
ipow a b - same as before, but more accurate
fpow a b - more accurate powers for floats
dpow a b - more accurate powers for doubles
round a b - rounds a, and puts it into new variable b

Input/Output

io out a - prints out a to the console
io nlout a - prints out a to the console with a newline appended
io in name - declares name as a string, then gets the input and stores it in name

Special Characters

Predefined variables

NEWLINE - \n - The newline character
SPACE - “ “ - a space
TRUE - true
FALSE - false

Comments

Comments start with a semicolon: “;”. Anything after the “;” will be ignored.
After v1.2.0, you can now add comments after code.

Miscellaneous

Example Programs