Skip to content
urkerab edited this page Aug 1, 2017 · 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 directions in x.
None Print dir num Prints a line x characters long in the directions 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. Moves the cursor down one line.
Box num num Prints a rectangle x characters wide, y characters tall. The border characters are automatic between +, | and -. The cursor is not moved.
Box num num str Prints a rectangle x characters wide, y characters tall, and using z as the border, repeating z if needed. Moves the cursor down one line.
UO Oblong num str Prints a square x characters wide and tall, and using y as the fill, repeating y if needed. The cursor is not moved.
UO Oblong num num str Prints a rectangle x characters wide, y characters tall, and using z as the fill, repeating z if needed. The cursor is not moved.
UR Rectangle num num Prints a rectangle x characters wide, y characters tall. The border characters are automatic between +, | and -. The cursor is not moved.
UR Rectangle num str Prints a square x characters wide and tall, and using y as the border, repeating y if needed. Moves the cursor down one line.
UR Rectangle num Prints a square x characters wide and tall. The border characters are automatic between +, | and -. The cursor is not moved.
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.
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.
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 dir Reflect the canvas in direction x.
Rotate Rotate the canvas 90 degrees counterclockwise.
Rotate num Rotate the canvas 45 degrees counterclockwise x times.
‖C ReflectCopy Reflect the canvas right. The original is kept and the axis is reflected.
‖C ReflectCopy dir Reflect the canvas in direction x. The original is kept and the axis is 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.
⟲C RotateCopy dir Rotate the canvas 90 degrees counterclockwise, with the pivot at the specified corner of the canvas. The original is kept.
⟲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. If x is a number literal greater than 10, RotateCopy is carried out on the original canvas once for each digit.
⟲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. If x is a number literal greater than 10, RotateCopy is carried out on the original canvas once for each digit.
‖T ReflectTransform Reflect the canvas right, the axis being perpendicular to x. The axis is reflected and characters are flipped if possible.
‖T ReflectTransform dir Reflect the canvas in direction x, the axis being perpendicular to x. The axis is reflected and characters are flipped if possible.
‖T ReflectTransform dls Call ReflectTransform for each direction in x.
⟲T RotateTransform Rotate the canvas 90 degrees counterclockwise, with the pivot at the bottom right of the canvas. Characters are rotated if possible.
⟲T RotateTransform num Rotate the canvas 45 degrees counterclockwise x times, with the pivot at the bottom right of the canvas. Characters are rotated if possible.
⟲P RotatePrism Rotate the canvas 90 degrees counterclockwise, with the pivot at the bottom right of the canvas. The original is kept 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 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 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 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 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.
‖M ReflectMirror Reflect the canvas right, the axis being perpendicular to x. The original is kept, the axis is not reflected and characters are flipped if possible.
‖M ReflectMirror dir Reflect the canvas in direction x, the axis being perpendicular to x. The original is kept, the axis is not reflected and characters are flipped if possible.
‖M ReflectMirror dls Call ReflectMirror for each direction in x.
‖O ReflectOverlap Reflect the canvas right. The axis is not reflected.
‖O ReflectOverlap dir Reflect the canvas in direction x. The axis is not reflected.
‖O ReflectOverlap dls Call ReflectOverlap for each direction in x.
‖OO ReflectOverlapOverlap num Reflect the canvas right. The axis and x lines closest to it are not reflected.
‖OO ReflectOverlapOverlap dir num Reflect the canvas in direction x. The axis and y lines closest to it are not reflected.
‖OO ReflectOverlapOverlap dls num Call ReflectOverlapOverlap with y for each direction in x.
‖B ReflectButterfly Reflect the canvas right. The axis is not reflected and characters are reflected if possible.
‖B ReflectButterfly dir Reflect the canvas in direction x. The axis is not reflected and characters are reflected if possible.
‖B ReflectButterfly dls Call ReflectOverlap for each direction in x.
‖BO ReflectButterflyOverlap num Reflect the canvas right. The axis and x lines closest to it are not reflected and characters are reflected if possible.
‖BO ReflectButterflyOverlap dir num Reflect the canvas in direction x. The axis and y lines closest to it are not reflected 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 characters are rotated if possible.
⟲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.
⟲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. If x is a number literal greater than 10, RotateOverlap is carried out on the original canvas once for each digit.
⟲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. If y is a number literal greater than 10, RotateOverlap is carried out on the original canvas once for each digit.
⟲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 characters are rotated if possible.
⟲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.
⟲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. If x is a number literal greater than 10, RotateOverlapOverlap is carried out on the original canvas once for each digit.
⟲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. If y is a number literal greater than 10, RotateOverlapOverlap is carried out on the original canvas once for each digit.
⟲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 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 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 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 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 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.
⟲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 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 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 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 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 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.
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
Evaluate/eval str Evaluates x as Charcoal code.
UP PythonFunction str lst Gets the function with no return value x from Python, and runs it with y as arguments.
Assign exp var Assigns the result of x to y.
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.
Clone this wiki locally