Skip to content
urkerab edited this page Sep 21, 2018 · 26 revisions

There are commands for many functions useful to ASCII-art. These are listed below. Arguments are x, y, z and a respectively. Argument types in {} denote that multiple can be given.

Input

Command Verbose Argument types Function
InputString var Stores the next string input as a string in x.
InputNumber var Stores the next string input as a number in x.

Output and Movement

Command Verbose Argument types Function
None Print dir str Prints y in the direction in x.
None Print dir num Prints a line y characters long in the direction in x. The character used is automatic between |, \ , / and -.
None Print str Prints x.
None Print num Prints a line x characters long. The character used is automatic between |, \ , / and -.
Multiprint mdr str Prints y in the directions in x. The cursor is not moved.
Multiprint mdr num Prints a line x characters long in the directions in x. The character used is automatic between |, \ , / and -. The cursor is not moved.
Multiprint str Prints x. The cursor is not moved.
Multiprint num Prints a line x characters long. The character used is automatic between |, \ , / and -. The cursor is not moved.
Box num str Prints a square x characters wide and tall, and using y as the border, repeating y if needed.
Box num num Prints a rectangle x characters wide, y characters tall. The border characters are automatic between +, | and -.
Box num num str Prints a rectangle x characters wide, y characters tall, and using z as the border, repeating z if needed.
UO Oblong num str Prints a square x characters wide and tall, and using y as the fill, repeating y if needed.
UO Oblong num num str Prints a rectangle x characters wide, y characters tall, and using z as the fill, repeating z if needed.
UR Rectangle num num Prints a rectangle x characters wide, y characters tall. The border characters are automatic between +, | and -.
UR Rectangle num str Prints a square x characters wide and tall, and using y as the border, repeating y if needed.
UR Rectangle num Prints a square x characters wide and tall. The border characters are automatic between +, | and -.
Polygon {dir num} str Prints a polygon with sides in x with the lengths in y and directions, and the z used to fill, repeating from the origin. If the polygon cannot be closed, it will not be filled.
Polygon mdr num str Prints a polygon with sides in x, all with length y, and the z used to fill, repeating from the origin. If the polygon cannot be closed, it will not be filled.
GH PolygonHollow {dir num} str Prints a polygon with sides in x with the lengths in y and directions, and the z used for the sides, repeating from the origin. Polygon is not autoclosed or filled.
GH PolygonHollow mdr num str Prints a polygon with sides in x, all with length y, and the z used for the sides, repeating from the origin. Polygon is not autoclosed or filled.
¤ Fill str If the cursor is in an empty space, fills the space with x, repeating x if needed.
UB SetBackground str Sets the background to x, padding if needed.
UT ToggleTrim Toggles whether output is right-padded.
Trim num num Removes any part of the canvas outside a rectangle x characters wide and y characters tall, starting at the cursor, but not above or to the left of the origin.
Clear Resets the canvas.
UE Extend num Puts an x-cell gap between every column.
UE Extend num num Puts an x-cell gap between every column, and a y-cell gap between every row.
Move num dir Move the cursor x characters in the direction of y.
Move dir Move the cursor one character in the direction of x.
None Move dir Move the cursor one character in the direction of x.
PivotLeft num Rotate the cursor 45 degrees counterclockwise x times.
PivotRight num Rotate the cursor 45 degrees clockwise x times.
PivotLeft Rotate the cursor 90 degrees left.
PivotRight Rotate the cursor 90 degrees right.
Move/Jump num num Jump x characters right, y characters down.
JumpTo num num Jump to the position x characters right, y characters down from the original position.

High-level canvas operation

Command Verbose Argument types Function
Reflect Reflect the canvas right, the axis being vertical through the cursor.
Reflect dir Reflect the canvas in direction x, the axis being perpendicular to x through the cursor.
Rotate Rotate the canvas 90 degrees counterclockwise around the cursor.
Rotate num Rotate the canvas 45 degrees counterclockwise x times around the cursor.
‖C ReflectCopy Reflect the canvas right. The original is kept and the axis and cursor position are reflected.
‖C ReflectCopy dir Reflect the canvas in direction x. The original is kept and the axis and cursor position are reflected.
‖C ReflectCopy dls Call ReflectCopy for each direction in x.
⟲C RotateCopy Rotate the canvas 90 degrees counterclockwise, with the pivot at the bottom right of the canvas. The original is kept and the cursor position is rotated.
⟲C RotateCopy dir Rotate the canvas 90 degrees counterclockwise, with the pivot at the specified corner of the canvas. The original is kept and the cursor position is rotated.
⟲C RotateCopy num Rotate the canvas 45 degrees counterclockwise x times, with the pivot at the bottom right of the canvas. The original is kept and the cursor position is rotated. If x is a number literal greater than 10, RotateCopy is carried out on the original canvas once for each digit.
⟲C RotateCopy lst Call RotateCopy for each value in x.
⟲C RotateCopy dir num Rotate the canvas 45 degrees counterclockwise x times, with the pivot at the specified corner of the canvas. The original is kept and the cursor position is rotated. If x is a number literal greater than 10, RotateCopy is carried out on the original canvas once for each digit.
⟲C RotateCopy dir lst Call RotateCopy with x for each value in y.
‖T ReflectTransform Reflect the canvas right, the axis being vertical. The cursor position and characters are reflected if possible.
‖T ReflectTransform dir Reflect the canvas in direction x, the axis being perpendicular to x. The cursor position and characters are reflected if possible.
‖T ReflectTransform dls Call ReflectTransform for each direction in x.
⟲T RotateTransform Rotate the canvas 90 degrees counterclockwise around the cursor position. Characters are rotated if possible.
⟲T RotateTransform num Rotate the canvas 45 degrees counterclockwise x times around the cursor position. Characters are rotated if possible.
⟲T RotateTransform lst Call RotateTransform for each value in x.
⟲P RotatePrism Rotate the canvas 90 degrees counterclockwise, with the pivot at the bottom right of the canvas. The original is kept and the cursor position and characters are rotated if possible.
⟲P RotatePrism dir Rotate the canvas 90 degrees counterclockwise, with the pivot at the specified corner of the canvas. The original is kept and the cursor position and characters are rotated if possible.
⟲P RotatePrism num Rotate the canvas 45 degrees counterclockwise x times, with the pivot at the bottom right of the canvas. The original is kept and the cursor position and characters are rotated if possible. If x is a number literal greater than 10, RotatePrism is carried out on the original canvas once for each digit.
⟲P RotatePrism lst Call RotatePrism for each value in x.
⟲P RotatePrism dir num Rotate the canvas 45 degrees counterclockwise y times, with the pivot at the specified corner of the canvas. The original is kept and the cursor position and characters are rotated if possible. If y is a number literal greater than 10, RotatePrism is carried out on the original canvas once for each digit.
⟲P RotatePrism dir lst Call RotatePrism with x for each value in y.
‖M ReflectMirror Reflect the canvas right, the axis being perpendicular to x. The original is kept, the axis and cursor position are reflected and characters are reflected if possible.
‖M ReflectMirror dir Reflect the canvas in direction x, the axis being perpendicular to x. The original is kept, the axis and cursor position are reflected and characters are reflected if possible.
‖M ReflectMirror dls Call ReflectMirror for each direction in x.
‖O ReflectOverlap Reflect the canvas right, the axis being vertical. The original is kept, the axis is not reflected and the cursor position is reflected.
‖O ReflectOverlap dir Reflect the canvas in direction x, the axis being perpendicular to x. The original is kept, the axis is not reflected and the cursor position is reflected.
‖O ReflectOverlap dls Call ReflectOverlap for each direction in x.
‖OO ReflectOverlapOverlap num Reflect the canvas right. The original is kept, the axis and x lines closest to it are not reflected and the cursor position is reflected.
‖OO ReflectOverlapOverlap dir num Reflect the canvas in direction x. The original is kept, the axis and x lines closest to it are not reflected and the cursor position is reflected.
‖OO ReflectOverlapOverlap dls num Call ReflectOverlapOverlap with y for each direction in x.
‖B ReflectButterfly Reflect the canvas right. The original is kept, the axis is not reflected and the cursor position and characters are reflected if possible.
‖B ReflectButterfly dir Reflect the canvas in direction x. The original is kept, the axis is not reflected and the cursor position and characters are reflected if possible.
‖B ReflectButterfly dls Call ReflectOverlap for each direction in x.
‖BO ReflectButterflyOverlap num Reflect the canvas right. The original is kept, the axis and x lines closest to it are not reflected and the cursor position and characters are reflected if possible.
‖BO ReflectButterflyOverlap dir num Reflect the canvas in direction x. The original is kept, the axis and y lines closest to it are not reflected and the cursor position and characters are reflected if possible.
‖BO ReflectButterflyOverlap dls num Call ReflectButterflyOverlap with y for each direction in x.
⟲O RotateOverlap Rotate the canvas 90 degrees counterclockwise, with the pivot on the character at the bottom right of the canvas. The original is kept and the cursor position is rotated.
⟲O RotateOverlap dir Rotate the canvas 90 degrees counterclockwise, with the pivot on the character at the specified corner of the canvas. The original is kept and the cursor position is rotated.
⟲O RotateOverlap num Rotate the canvas 45 degrees counterclockwise x times, with the pivot on the character at the bottom right of the canvas. The original is kept and the cursor position is rotated. If x is a number literal greater than 10, RotateOverlap is carried out on the original canvas once for each digit.
⟲O RotateOverlap lst Call RotateOverlap for each value in x.
⟲O RotateOverlap dir num Rotate the canvas 45 degrees counterclockwise y times, with the pivot on the character at the specified corner of the canvas. The original is kept and the cursor position is rotated. If y is a number literal greater than 10, RotateOverlap is carried out on the original canvas once for each digit.
⟲O RotateOverlap dir lst Call RotateOverlap with x for each value in y.
⟲OO RotateOverlapOverlap num Rotate the canvas 90 degrees counterclockwise, with the pivot on the character at the bottom right of the canvas, shifted x/2 cells up and to the left. The original is kept and the cursor position is rotated.
⟲OO RotateOverlapOverlap dir num Rotate the canvas 90 degrees counterclockwise, with the pivot on the character at the specified corner of the canvas, shifted y/2 cells in the opposite direction to x. The original is kept and the cursor position is rotated.
⟲OO RotateOverlapOverlap num num Rotate the canvas 45 degrees counterclockwise x times, with the pivot on the character at the bottom right of the canvas, shifted y/2 cells up and to the left. The original is kept and the cursor position is rotated. If x is a number literal greater than 10, RotateOverlapOverlap is carried out on the original canvas once for each digit.
⟲OO RotateOverlapOverlap lst num Call RotateOverlapOverlap for each value in x with y.
⟲OO RotateOverlapOverlap dir num num Rotate the canvas 45 degrees counterclockwise y times, with the pivot on the character at the specified corner of the canvas, shifted z/2 cells in the opposite direction to x. The original is kept and the cursor position is rotated. If y is a number literal greater than 10, RotateOverlapOverlap is carried out on the original canvas once for each digit.
⟲OO RotateOverlapOverlap dir lst num Call RotateOverlapOverlap with x for each value in y with z.
⟲S RotateShutter Rotate the canvas 90 degrees counterclockwise, with the pivot on the character at the bottom right of the canvas. The original is kept and the cursor position and characters are rotated if possible.
⟲S RotateShutter dir Rotate the canvas 90 degrees counterclockwise, with the pivot on the character at the specified corner of the canvas. The original is kept and the cursor position and characters are rotated if possible.
⟲S RotateShutter num Rotate the canvas 45 degrees counterclockwise x times, with the pivot on the character at the bottom right of the canvas. The original is kept and the cursor position and characters are rotated if possible. If x is a number literal greater than 10, RotateShutter is carried out on the original canvas once for each digit.
⟲S RotateShutter lst Call RotateShutter for each value in x.
⟲S RotateShutter dir num Rotate the canvas 45 degrees counterclockwise y times, with the pivot on the character at the specified corner of the canvas. The original is kept and the cursor position and characters are rotated if possible. If y is a number literal greater than 10, RotateShutter is carried out on the original canvas once for each digit.
⟲S RotateShutter dir lst Call RotateShutter with x for each value in y.
⟲SO RotateShutterOverlap num Rotate the canvas 90 degrees counterclockwise, with the pivot on the character at the bottom right of the canvas, shifted x/2 cells up and to the left. The original is kept and the cursor position and characters are rotated if possible.
⟲SO RotateShutterOverlap dir num Rotate the canvas 90 degrees counterclockwise, with the pivot on the character at the specified corner of the canvas, shifted y/2 cells in the opposite direction to x. The original is kept and the cursor position and characters are rotated if possible.
⟲SO RotateShutterOverlap num num Rotate the canvas 45 degrees counterclockwise x times, with the pivot on the character at the bottom right of the canvas, shifted y/2 cells up and to the left. The original is kept and the cursor position and characters are rotated if possible. If x is a number literal greater than 10, RotateShutterOverlap is carried out on the original canvas once for each digit.
⟲SO RotateShutterOverlap lst num Call RotateShutterOverlap for each value in x with y.
⟲SO RotateShutterOverlap dir num num Rotate the canvas 45 degrees counterclockwise y times, with the pivot on the character at the specified corner of the canvas, shifted z/2 cells in the opposite direction to x. The original is kept and the cursor position and characters are rotated if possible. If y is a number literal greater than 10, RotateShutterOverlap is carried out on the original canvas once for each digit.
⟲SO RotateShutterOverlap dir lst num Call RotateShutterOverlap with x for each value in y with z.
Copy num num Copy the canvas x characters right and y characters down.

Control flow

Command Verbose Argument types Function
¿ if exp bdy bdy If x evaluates to truthy, run y, else run z.
¿ if exp bdy If x evaluates to truthy, run y.
for exp bdy Iterate over x, running y once per iteration. The loop variable is stored in the first free variable in ικλμνξπρςστυφχψωαβγδεζηθ. If x is a number, iterate over range(x) instead.
while exp bdy Iterate while x is true, running y once per iteration. The result of x is stored in the first free variable in ικλμνξπρςστυφχψωαβγδεζηθ.
RF RefreshFor num exp bdy Iterate over y, running z and refreshing once per iteration with a minimum of x milliseconds timeout before the screen will be refreshed again. The loop variable is stored in the first free variable in ικλμνξπρςστυφχψωαβγδεζηθ. If y is a number, iterate over range(y) instead.
RW RefreshWhile num exp bdy Iterate while y is true, running z and refreshing once per iteration with a minimum of x milliseconds timeout before the screen will be refreshed again. The result of y is stored in the first free variable in ικλμνξπρςστυφχψωαβγδεζηθ.

Display

Command Verbose Argument types Function
Dump Output the contents of the canvas. This has a 10 millisecond minimum interval by default.
Refresh num Refresh the screen with the contents of the canvas, with a minimum of x milliseconds timeout before the screen will be refreshed again.

Miscellaneous

Command Verbose Argument types Function
UP PythonFunction str lst Gets the function with no return value x from Python, and runs it with y as arguments.
ExecuteVariable/execvar var wls Executes function or Charcoal function stored in x with y as arguments.
ExecuteVariable/execvar var wex Executes function or Charcoal function stored in x with y as argument.
UX PythonExecute/pyexec str Executes x as Python code.
Assign exp var Assigns the result of x to y.
§≔ AssignAtIndex exp exp exp Assigns the result of z to the yth element of x.
Push exp exp Pushes y to x.
switch exp {exp bdy} Depending on the value of x, executes z where x == y.
switch exp {exp bdy} bdy Depending on the value of x, executes z where x == y or a if x does not match any y.
/ MapAssign op var Assigns the result of op var to var, where op is a non-lazy unary operator. Vectorises.
MapAssignLeft op exp var Assigns the result of op exp var to var, where op is a non-lazy binary operator. Vectorises.
MapAssignRight op exp var Assigns the result of op var exp to var, where op is a non-lazy binary operator. Vectorises.