-
Notifications
You must be signed in to change notification settings - Fork 10
Index
TIO refers to Try it online! while ATO refers to Attempt This Online!.
-
Print(str);
. Writes the string to the canvas. -
Print(int);
. Writes a line of one of-
,|
,/
or\
depending on the current direction of the given length to the canvas. -
Print(list);
. For each element of list, prints it in the current direction without moving the cursor and then moves down a line.
Used by Wolfram expressions.
Logical And(any, any)
. Returns the first argument if it is falsy, otherwise it evaluates the second argument.
Logical Or(any, any)
. Returns the first argument if it is truthy, otherwise it evaluates the second argument.
Starts a compressed string, which is a separate token from ASCII strings.
Starts a literal string (a string containing these command characters, excluding
”
,¶
or⸿
). (TIO:¶
or⸿
will also be quoted, but the deverbosifier erroneously converts\n
or\r
.)
Ends a compressed or literal string. Optional at the end of the program.
Push(list, any);
. Appends the value to the list.
PushOperator(list, any)
. Appends the value to the list and returns the list.
Pop(list)
. Removes and returns the last element of the list.
Used by Wolfram expressions.
Used by Wolfram expressions.
Used by Wolfram expressions.
\n
. Literal newline character; counts as part of an ASCII string literal. When printed to the canvas, causes the cursor to move to the start of the next "line" below the cursor position at the start of the print command.
Used by Wolfram expressions.
-
BitwiseAnd(int, int)
. -
BitwiseAnd(int, list)
. Recursively vectorises over the list. -
BitwiseAnd(list, int)
. Recursively vectorises over the list.
-
BitwiseOr(int, int)
. -
BitwiseOr(int, list)
. Recursively vectorises over the list. -
BitwiseOr(list, int)
. Recursively vectorises over the list. -
BitwiseOr(string, string)
. Creates a pair of Wolfram strings.
PivotLeft(int=2);
. Rotates the default output direction anticlockwise by 45° times the argument.
PivotRight(int=2);
. Rotates the default output direction clockwise by 45° times the argument.
Rotate(int=2);
. Rotates the canvas anticlockwise by 45° times the argument.
RotateTransform(int=2);
. Rotates the canvas anticlockwise by 45° times the argument, rotating the characters if possible.
RotateCopy(dir=↘, literal);
. Rotates the canvas anticlockwise by 45° times each digit in the literal around the given corner of the canvas, overlaying the copies over the original.RotateCopy(dir=↘, int=2);
. Rotates the canvas anticlockwise by 45° times the argument around the given corner of the canvas, overlaying the copy over the original.RotateCopy(dir=↘, list);
. For each element oflist
, rotates the canvas anticlockwise by 45° times the element around the given corner of the canvas, overlaying the copy over the original.
RotatePrism(dir=↘, literal);
.RotatePrism(dir=↘, int=2);
.RotatePrism(dir=↘, list);
.Like
RotateCopy
but rotates the characters if possible.
RotateOverlap(dir=↘, literal);
.RotateOverlap(dir=↘, int=2);
.RotateOverlap(dir=↘, list);
.Like
RotateCopy
but rotates around the character in the corner (so that the rotated character overlaps itself).
RotateOverlapOverlap(dir=↘, literal, int);
.RotateOverlapOverlap(dir=↘, int=2, int);
.RotateOverlapOverlap(dir=↘, list, int);
.Like
RotateOverlap
but specifies the amount of overlap.
RotateShutter(dir=↘, literal);
.RotateShutter(dir=↘, int=2);
.RotateShutter(dir=↘, list);
.Like
RotateOverlap
but rotates the characters if possible.
RotateShutterOverlap(dir=↘, literal, int);
.RotateShutterOverlap(dir=↘, int=2, int);
.RotateShutterOverlap(dir=↘, list, int);
.Like
RotateShutter
but specifies the amount of overlap.
-
:Left
. Used as a direction parameter to other commands. -
Move(:Left);
. Moves the cursor one character to the left. -
Print(:Left, any);
. Prints the argument as if the pivot was pointing to the left.
-
:Up
. Used as a direction parameter to other commands. -
Move(:Up);
. Moves the cursor one character up. -
Print(:Up, any);
. Prints the argument as if the pivot was pointing up.
-
:Right
. Used as a direction parameter to other commands. -
Move(:Right);
. Moves the cursor one character to the right. -
Print(:Right, any);
. Prints the argument as if the pivot was pointing to the right.
-
:Down
. Used as a direction parameter to other commands. -
Move(:Down);
. Moves the cursor one character down. -
Print(:Down, any);
. Prints the argument as if the pivot was pointing down.
Ternary(any, any, any)
. Evaluates the second argument if the first argument is truthy or the third argument if it is falsy.
-
Random()
. Returns0
or1
randomly. -
Random(int)
. Returns a random integer from0
to (but not including) the argument. (Must be at least1
.) -
Random(str)
. Returns a random character from the string. (Must not be an empty string.) -
Random(list)
. Returns a random element from the list. (Must not be an empty list.)
-
Lowercase(str)
. Returns the given string in lowercase. -
Lowercase(list)
. Recursively vectorises over the list. (Does not work on empty lists on TIO.)
-
Uppercase(str)
. Returns the given string in uppercase. -
Uppercase(list)
. Recursively vectorises over the list. (Does not work on empty lists on TIO.)
-
Floor(float)
. -
Minimum(str)
. Returns the character with the lowest Unicode codepoint. (ATO: Returns the empty string if the input was empty.) -
Minimum(list)
. ReturnsNone
if the list is empty.
-
Ceiling(float)
. -
Maximum(str)
. Returns the character with the highest Unicode codepoint. (ATO: Returns the empty string if the input was empty.) -
Maximum(list)
. ReturnsNone
if the list is empty.
-
Negate(number)
. (Does not work on complex numbers on TIO.) -
Negate(string)
. Removes a leading-
, or adds one if none was present. (Not available on TIO.) -
Negate(list)
. Recursively vectorises over the list. (Not recursive on TIO.)
-
:UpLeft
. Used as a direction parameter to other commands. -
Move(:UpLeft);
. Moves the cursor one character up and to the left. -
Print(:UpLeft, any);
. Prints the argument as if the pivot was pointing up and to the left.
-
:UpRight
. Used as a direction parameter to other commands. -
Move(:UpRight);
. Moves the cursor one character up and to the right. -
Print(:UpRight, any);
. Prints the argument as if the pivot was pointing up and to the right.
-
:DownRight
. Used as a direction parameter to other commands. -
Move(:DownRight);
. Moves the cursor one character down and to the right. -
Print(:DownRight, any);
. Prints the argument as if the pivot was pointing down and to the right.
-
:DownLeft
. Used as a direction parameter to other commands. -
Move(:DownLeft);
. Moves the cursor one character down and to the left. -
Print(:DownLeft, any);
. Prints the argument as if the pivot was pointing down and to the left.
-
StringMap(int, any)
. Evaluates the given expression for each of the integers from0
up to the first argument and joins the results into a string. -
StringMap(iter, any)
. Evaluates the given expression for each of the elements of the first argument and joins the results into a string. (Does not work on dictionaries on TIO.)
Used by Wolfram expressions.
Join(str, iter)
. Converts the the elements of the iterable to string and joins them using the first argument. (ATO: Also converts the first argument to string.)
-
Split(iter, int)
. Splits the argument into pieces of the given length (with a short piece at the end if necessary). -
Split(str, str)
. Splits the first argument at matches of the second argument. -
Split(str, list)
. Splits the first argument at matches of the elements of the second argument. (Not available on TIO.)
-
Character(int)
. Returns the Unicode character with the given codepoint. -
Ordinal(char)
. Returns the code point of the given Unicode character. -
Ordinal("")
. Returns0
.
PadLeft(str, int)
. Pads the first argument with spaces if its length is less than the second argument.
PadRight(str, int)
. Pads the first argument with spaces if its length is less than the second argument.
-
Reverse(iter)
. Reverses the order of the elements or characters in the argument. -
Reverse(number)
. Reverses the digits in the number, including any decimal point but excluding the sign. (Only works for positive integers on TIO.)
switch (any) { case:s... (default:) }
Like
switch
but uses a closing»
to mark the end of the switch statement. (Technically the closing»
is optional at the end of the program but in that case you would simply omit the«
.) Useswitch_delimited
in Verbose mode. (Not available on TIO.)
-
Count(str, str)
. Counts the number of non-overlapping matches of the second argument in the first. (UseLength(FindAll(str, str))
to count overlapping matches.) -
Count(iter, any)
. Counts the number of occurrences of the given value in the iterable's elements. (Does not work on dictionaries on TIO.)
-
Any(int, any)
. Evaluates the given expression for each of the integers from0
up to the first argument and returns1
if any value is truthy or0
if not. (Not available on TIO.) -
Any(iter, any)
. Evaluates the given expression for each of the elements of the first argument and returns1
if any value is truthy or0
if not. (Does not work on dictionaries on TIO.)
\r
. Literal carriage return character; counts as part of an ASCII string literal. When printed to the canvas, causes the cursor to move to the start of the next line.
-
All(int, any)
. Evaluates the given expression for each of the integers from0
up to the first argument and returns1
if all of the values are truthy or0
if not. (Not available on TIO.) -
All(iter, any)
. Evaluates the given expression for each of the elements of the first argument and returns1
if all of the values are truthy or0
if not. (Does not work on dictionaries on TIO.)
Assign(any, var);
.
AssignAtIndex(list, int, any);
. Updates an element of a dictionary, or of a list (including list of cells) using cyclic indexing.
GetVariable(str)
. Gets a Charcoal variable indirectly by succinct name or a Python constant such as math.tau
.
-
EvaluateVariable(str);
. Executes the named Python function. -
EvaluateVariable(str, list);
. Executes the named Python function, passing it the given arguments. Note: Only works with literal lists; variable numbers of arguments are not supported. -
EvaluateVariable(str, value);
. Executes the named Python function, passing it the given argument.
ExecuteVariable(str, list);
. Executes the named Python function, passing it the given arguments.
-
Slice(list)
. Returns a shallow clone oflist
. -
Slice(iter, int)
. Returns the argument with the given number of elements removed from the front, or the last elements of the argument if the given number is negative. -
Slice(iter, int, int)
. Returns the given range of elements of the argument. -
Slice(iter, int, int, int)
. Returns the given range including step of elements of the argument.
-
Sum(number)
. Returns the sum of the digits of the argument, excluding any exponent. -
Sum(str)
. If the argument looks like a number, returns the sum of its digits, otherwise returns the sum of any embedded numbers, or0
if there were none. (TIO: Only supports positive numbers.) -
Sum(list)
. Returns the sum, join or concatenation of the elements of the list depending on whether the first element is an integer, string or list. (Does not work on lists of lists on TIO).
-
Product(int)
. Returns the product of the digits of the argument. -
Product(float)
. Returns the product of the non-zero digits of the argument, excluding any exponent. -
Product(str)
. If the argument looks like a number, returns the product of its digits, otherwise returns the product of any embedded numbers, or1
if there were none. (TIO: Only supports positive numbers.) -
Product(list)
. Returns the product of the elements of the list, or1
if there were none (None
if there were none on TIO).
-
Base(int, int)
. Converts the first argument to an array of integers representing it in the base of the second argument, with the most significant digit first. Returns an empty array if the first argument is0
. -
Base(int, str)
. Equivalent toBaseString(int, str)
. -
Base(str, int)
. Equivalent toBaseString(int, str)
. -
Base(str, str)
. Equivalent toBaseString(str, str)
but with the arguments swapped. -
Base(list, int)
. Evaluates the list as a polynomial using the second argument, with the most significant degree first. This also works for converting a number from a custom base. If the number is0
, returns the last element of the list, or0
if it was empty. (Does not remove the last element likePop
would.) If the number is1
, returns the sum of the list, or0
if it was empty. (Sum
does not work in this case.) -
Base(int, list)
. Equivalent toBase(list, int)
.
-
BaseString(number, int)
. Converts the first argument to a string representing it in the base of the second argument, using the characters0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
as digits, with the most significant digit first. Returns0
if the first argument is0
. -
BaseString(number, str)
. Converts the number to a string representing it in the base of the length of the given string, using its characters as digits, with the most significant digit first. Returns the first character of the given string if the first argument is0
(0
if the first argument is0
on TIO). Does not convert a floating-point fraction if the given string contains.
. -
BaseString(number, list)
. Converts the number to a string representing it in the base of the length of the list, using its elements as digits, with the most significant digit first. Returns the first element of the list if the first argument is0
(0
if the first argument is0
on TIO). Does not convert a floating-point fraction if the list contains.
. -
BaseString(str, int)
. Converts the first argument as if it was a representation of the base of the second argument, using the characters0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
as digits, with the most significant digit first. -
BaseString(str, str)
. Converts the first argument as if it was a representation of the base of the length of the second argument, using its characters as digits, with the most significant digit first. -
BaseString(str, list)
. LikeBaseString(str, str)
but using a list of characters instead of a string. -
BaseString(list, int)
. LikeBaseString(str, int)
but using a list of characters instead of a string. -
BaseString(list, str)
. LikeBaseString(str, str)
but using a list of characters instead of a string. -
BaseString(list, list)
. Converts the first argument as if it was a representation of the base of the length of the second argument, using its elements as digits, with the most significant digit first.
-
Direction(int)
. Represents a computed direction arrow where0
is→
and7
is↘
. -
Direction(string)
. Represents a computed direction arrow where the string is any ofUp
,Down
,Left
,Right
or their combinations, or a nontrivial prefix thereof, in any case, considering only the letters of the string.
Directions(list)
. Represents a computed multidirectional given by the elements of the list as individual direction arrows.
-
Absolute(number)
. Returns the norm of the number. (Does not work on complex numbers on TIO.) -
Absolute(string)
. Removes a leading-
from the string. (Not available on TIO.) -
Absolute(list)
. Recursively vectorises over the list. (Does not work on empty lists on TIO.)
-
MapAssign(unary, var);
. Applies the unary operator to the contents of the variable and updates the variable. Works for integers and vectorises over lists. -
MapAssignLeft(binary, any, var);
. Applies the binary operator to the given value and the contents of the variable and updates the variable. Works for integers and vectorises over lists (and strings if the binary operator returns a string).
-
MapAssign(unary, var);
. Applies the unary operator to the contents of the variable and updates the variable. Works for integers and lists. -
MapAssignRight(binary, any, var);
. Applies the binary operator to the contents of the variable and the given value and updates the variable. Works for integers and vectorises over lists (and strings if the binary operator returns a string).
X()
. Returns the X-coordinate of the cursor position on the canvas.
Y()
. Returns the Y-coordinate of the cursor position on the canvas.
-
Find(str, str)
. Finds the index of the second string in the first, or-1
if the string is not present. -
Find(list, any)
. Finds the index of the value in the list, or-1
if the value is not present. (Does not work on dictionaries on TIO.) -
Find(dict, any)
. Finds the index of the value in the dictionary, orNone
if the value is not present. (Not available on TIO.)
FindAll(str, str)
. Returns a list of indices of overlapping matches of the second string in the first.FindAll(iter, any)
. Returns a list of indices of the value in the iterable. (Does not work on dictionaries on TIO.)
-
Incremented(number)
. (Does not work on complex numbers and rounds to nearest1e-15
on TIO.) -
Incremented(list)
. Recursively vectorises overlist
. (Does not work on empty lists on TIO.)
-
Decremented(number)
. (Does not work on complex numbers and rounds to nearest1e-15
on TIO.) -
Decremented(list)
. Recursively vectorises overlist
. (Does not work on empty lists on TIO.)
-
Doubled(number)
. (Does not work on complex numbers and rounds to nearest1e-15
on TIO.) -
Doubled(list)
. Recursively vectorises overlist
. (Does not work on empty lists on TIO.)
-
Halved(number)
. (Does not work on complex numbers and always floating-point and rounds to nearest1e-15
on TIO, but integer divide if the original value is even on ATO.) -
Halved(list)
. Recursively vectorises overlist
. (Does not work on empty lists on TIO.)
Clear();
. Clears the canvas and moves the cursor to the origin, but does not change other settings such as the pivot direction.
Not(any)
. Returns 1
if the value is falsy, 0
otherwise.
-
SquareRoot(number)
. (Does not work on complex numbers on TIO.) -
SquareRoot(list)
. Recursively vectorises overlist
. (Not available on TIO.)
-
Filter(int, any)
. Returns a list of the integers from0
up to the argument where the expression is truthy. -
Filter(iter, any)
. Returns an iterable containing only those elements where the expression is truthy. (Does not work on dictionaries on TIO.)
AtIndex(iter, int)
. Indexes into a dictionary, or cyclically indexes into a list or string. (TIO: Returns the empty string if the result would be the null character.)
AssignAtIndex(list, int, any);
. Updates an element of a dictionary, or of a list (including a list of cells) using cyclic indexing.
-
Modulo(number, number)
. -
Modulo(str, number)
. Formats a string with a single format parameter. -
Modulo(str, str)
. Formats a string with a single format parameter. -
Modulo(list, number)
. Recursively vectorises overlist
. -
Modulo(list, str)
. Recursively vectorises overlist
. -
Modulo(str, list)
. Recursively vectorises overlist
. -
Modulo(number, list)
. Recursively vectorises overlist
.
Begins a block or a lambda.
Ends a block or lambda. Optional at the end of the program.
-
Times(number, number)
. -
Times(str, number)
. -
Times(number, str)
. Repeats the string the given number of times, including fractional parts of the string, e.g.Times(1.5, "12")
gives"121"
. -
Times(list, str)
. Joins the elements of the list with the string. -
Times(str, list)
. Joins the elements of the list with the string. -
Times(list, number)
. Recursively vectorises overlist
. (Not recursive on TIO.) -
Times(number, list)
. Recursively vectorises overlist
. (Not recursive on TIO.) -
Times(list, list)
. Pairwise recursive multiplication. (Not available on TIO.)
-
Plus(number, number)
. -
Plus(iter, iter)
. Concatenates two iterators of the same type. (Does not work on dictionaries on TIO.) -
Plus(list, number)
. Recursively vectorises overlist
. (Not recursive on TIO.) -
Plus(list, str)
. Recursively vectorises overlist
. (Not recursive on TIO.) -
Plus(number, list)
. Recursively vectorises overlist
. (Not recursive on TIO.) -
Plus(str, list)
. Recursively vectorises overlist
. (Not recursive on TIO.)
-
Minus(number, number)
. -
Minus(str, str)
. Removes matches of the second string from the first. -
Minus(list, list)
. Filters out elements of the first list that appear in the second. -
Minus(dict, dict)
. Filters out elements of the first dictionary whose keys appear in the second. (Not available on TIO.) -
Minus(list, number)
. Recursively vectorises overlist
. (Not recursive on TIO.) -
Minus(list, str)
. Recursively vectorises overlist
. (Not recursive on TIO.) -
Minus(number, list)
. Recursively vectorises overlist
. (Not recursive on TIO.) -
Minus(str, list)
. Recursively vectorises overlist
. (Not recursive on TIO.)
Used as the decimal point in a floating-point literal.
- See also
…·
.
-
IntDivide(number, number)
. Integer or truncating division. -
IntDivide(str, number)
. -
IntDivide(number, str)
. Repeats the string the reciprocal of given number of times, including fractional parts of the string, e.g.Divide("121", 1.5)
gives"12"
. -
IntDivide(str, str)
. Splits the first string at occurrences of the second. -
IntDivide(list, number)
. Recursively vectorises overlist
. (Not recursive on TIO.) -
IntDivide(number, list)
. Recursively vectorises overlist
. (Not recursive on TIO.)
Used to create integer and floating-point literals.
Used to separate consecutive integers or strings or as placeholders for optional arguments.
Reflect(dir=→);
. Reflects the canvas in the specified direction.
ReflectTransform(dir=→);
. Reflects the canvas in the specified direction, reflecting the characters if possible.
ReflectCopy(dirs=→);
. Reflects the canvas in each specified direction in turn, adding the reflected copy to the canvas after each reflection.
ReflectMirror(dirs=→);
. LikeReflectCopy
but reflecting the characters if possible.
ReflectOverlap(dirs=→);
. LikeReflectCopy
but reflects around the edge characters (so that the reflected axis overlaps itself).
ReflectButterfly(dirs=→);
. LikeReflectOverlap
but reflecting the characters if possible.
ReflectOverlapOverlap(dirs=→, num);
. LikeReflectOverlap
but specifies the amount of overlap.
ReflectButterflyOverlap(dirs=→, num);
. LikeReflectOverlapOverlap
but reflecting the characters if possible.
-
Less(number, number)
. -
Less(str, str)
. -
Less(list, list)
. Compares using Python's<
operator.
Equals(any, any)
.
-
Greater(number, number)
. -
Greater(str, str)
. -
Greater(list, list)
. Compares using Python's>
operator.
-
if (any) stmt
. -
if (any) stmt else stmt
.
Note that the first form is only possible at the end of a block or program.
-
Input()
. Returns the next input, but doesn't cast it to string or integer. Only relevant for JSON input. -
Input(var);
. Setsvar
to the the next input, but doesn't cast it to string or integer. Only relevant for JSON input.
PeekAll()
. Returns a list of all the non-background cells in the canvas. Cells can be assigned to usingAssignAtIndex
.
- See also
⌕A
.
-
Box(int, str);
. Draws the string around the sides of a square of the given size. -
Box(int, int);
. Draws a rectangle of the given size, using+
s for the corners and-
s and|
s for the horizontal and vertical sides. -
Box(int, int, str);
. Draws the string around the sides of a rectangle of the given size.
ReflectButterfly(dirs=→);
. LikeReflectOverlap
but reflecting the characters if possible.
ReflectButterflyOverlap(dirs=→, num);
. LikeReflectOverlapOverlap
but reflecting the characters if possible.
SetBackground(str);
. Sets the string that should fill the background when the canvas is output. Defaults to a space.
Copy(int, int);
. Overlays the canvas with a copy of it offset by the given horizontal and vertical amounts.
ReflectCopy(dirs=→);
. Reflects the canvas in each specified direction in turn, adding the reflected copy to the canvas after each reflection.
- See also
⟲C
.
Dump();
. Outputs a copy of the canvas to standard output. Delays by 10 milliseconds since the last dump. (ATO: Use --nt
to disable the delay.)
PeekDirection(int, dir)
. Returns a list of the cell under the cursor and continuing in the given direction up to the given length. Cells can be assigned to usingAssignAtIndex
.
-
Map(int, any)
. Evaluates the given expression for each of the integers from0
up to the first argument and returns a list of the results. -
Map(iter, any)
. Evaluates the given expression for each of the elements of the first argument and returns a list of the results. (Does not work on dictionaries on TIO.) - See also
UE
.
-
for (int)
. Loops over the integers from0
up to the argument. -
for (iter)
. Loops over the elements of the argument. (Does not work on dictionaries on TIO.) - See also
RF
.
-
Polygon(dir, int, ... str);
. Draws a polygon using the given directions and lengths, filling it with the given string. (Note that the lengths are inclusive.) -
Polygon(dirs, int, str);
. Draws a polygon using the given directions and length, filling it with the given string. (Note that the length is inclusive.)
PolygonHollow(dir, int, ... str);
. Draws the string along the given directions and path lengths. (Note that the lengths are inclusive.)PolygonHollow(dirs, int, str);
. Draws the string along the given directions and path length. (Note that the length is inclusive.)
Only used as a modifier; see GH
.
-
Cast(number)
. Casts the value to a string. (TIO: Tries to remove the trailing.0
for floating-point values that represent integers, but floors the result instead of rounding it. Also the output for large floating-point values is suboptimal.) -
Cast(str)
. Interprets the contents of string as a Python literal, or returns0
if the string is empty. (TIO: Only supports integers and floats.) -
Cast(list)
. Recursively vectorises over the list.
JumpTo(int, int);
. Moves the cursor to the given absolute position.
PeekAll()
. Returns a list of all the non-background cells in the canvas. Cells can be assigned to usingAssignAtIndex
.
PeekDirection(int, dir)
. Returns a list of the cell under the cursor and continuing in the given direction up to the given length. Cells can be assigned to usingAssignAtIndex
.
Peek()
. Returns the character under the cursor.
PeekMoore()
. Returns a list of the cells orthogonally and diagonally adjacent, starting with the cell above and to the left and working clockwise around the cursor. Cells can be assigned to usingAssignAtIndex
.
PeekVonNeumann()
. Returns a list of the cells orthogonally adjacent, starting with the cell above and working clockwise around the cursor. Cells can be assigned to usingAssignAtIndex
.
Length(iter)
. Returns the length of the iterable.
-
Move(dir)
. Moves one character in the given direction. Needed if the direction would otherwise be interpreted as aPrint
command. -
Move(int, dir)
. Moves one character the given amount in the given direction. -
Move(int, int)
. Moves the cursor to the given relative position.
MapCommand(iter, any);
. Evaluates the given expression for each of the elements of the first argument and updates the argument if possible. (Does not work on dictionaries on TIO.)
- See also
KM
.
-
InputNumber()
. Returns the next input cast to number. (ATO: Accepts any Python literal.) -
InputNumber(var);
. Setsvar
to the the next input cast to number. (ATO: Accepts any Python literal.)
Only used as a modifier.
PushOperator(list, any)
. Appends the value to the list and returns the list.
-
Multiprint(str);
Writes the string to the canvas without moving the cursor. -
Multiprint(int);
Writes a line of one of-
,|
,/
or\
depending on the current direction of the given length to the canvas without moving the cursor. -
Multiprint(dirs, str);
Writes the string to the canvas in each of the specified directions without moving the cursor. -
Multiprint(dirs, int);
Writes the appropriate lines of-
,|
,/
or\
for each direction of the given length to the canvas without moving the cursor. Note that the resulting character under the cursor will be that of the last direction used. - See also
⟲P
.
Unused.
Refresh(int=0);
Displays the canvas to the screen, but with an optional delay since the last refresh.
RefreshWhile(any)
Loops while the argument is true, saving it in the next loop variable, but displays the canvas at every step, with the given delay. The argument is evaluated after theRefreshWhile
loop variable is reserved.
RefreshFor(int, int)
. Loops over the integers from0
up to the second argument, but displays the canvas at every step, with the given delay.RefreshFor(int, iter)
. Loops over the elements of the argument, but displays the canvas at every step, with the given delay.
- See also
UR
.
-
InputString()
. Returns the next input cast to string. -
InputString(var);
. Setsvar
to the the next input cast to string. - See also
⟲S
. - See also
⟲SO
.
-
Trim(int);
. Removes any part of the canvas outside the square with the given size having its top left at the cursor position, but also any part of the canvas above or to the left of the origin. -
Trim(int, int);
. Removes any part of the canvas outside the rectangle with the given size having its top left at the cursor position, but also any part of the canvas above or to the left of the origin.
RotateTransform(int=2);
. Rotates the canvas anticlockwise by 45° times the argument, rotating the characters if possible.
ReflectTransform(dir=→);
. Reflects the canvas in the specified direction, reflecting the characters if possible.
ToggleTrim();
. Toggles whether the canvas output is right-padded (default true).
SetBackground(str);
. Sets the string that should fill the background when the canvas is output. Defaults to a space.
Extend(int);
. Inserts a gap between every column of the canvas.Extend(int, int);
. Inserts a gap between every column and row of the canvas.
MapCommand(iter, any);
. Evaluates the given expression for each of the elements of the first argument and updates the argument if possible. (Does not work on dictionaries on TIO.)
Oblong(int, str);
. Fills a square of the given size with the string.Oblong(int, int, str);
. Fills a rectangle of the given size with the string.
Rectangle(int);
. Draws a square of the given size, using+
s for the corners and-
s and|
s for the horizontal and vertical sides.Rectangle(int, str);
. Draws the string around the sides of a square of the given size.Rectangle(int, int);
. Draws a rectangle of the given size, using+
s for the corners and-
s and|
s for the horizontal and vertical sides.
ToggleTrim();
. Toggles whether the canvas output is right-padded (default true).
PythonEvaluate()
. Evaluates the string as Python code.
PythonExecute(str)
. Executes the string as Python code.
-
Evaluate(str)
Evalutes the string as Charcoal code. -
Evaluate(str);
Executes the string as Charcoal code.
PeekVonNeumann()
. Returns a list of the cells orthogonally adjacent, starting with the cell above and working clockwise around the cursor. Cells can be assigned to usingAssignAtIndex
.
PythonEvaluate()
. Evaluates the string as Python code.
while (any)
Loops while the argument is true, saving it in the next loop variable. The argument is evaluated after thewhile
loop variable is reserved.
RefreshWhile(any)
Loops while the argument is true, saving it in the next loop variable, but displays the canvas at every step, with the given delay. The argument is evaluated after theRefreshWhile
loop variable is reserved.
-
Power(number, number)
. -
Power(list, number)
. Recursively vectorises over the list. -
Power(number, list)
. Recursively vectorises over the list.
PythonExecute(str)
. Executes the string as Python code.
Unused.
Unused
Begins a list.
-
Divide(number, number)
. Floating-point division. -
Divide(str, number)
. -
Divide(number, str)
. Repeats the string the reciprocal of given number of times, including fractional parts of the string, e.g.Divide("121", 1.5)
gives"12"
. -
Divide(str, str)
. Splits the first string at occurrences of the second. -
Divide(list, number)
. Recursively vectorises overlist
. (Not recursive on TIO.) -
Divide(number, list)
. Recursively vectorises overlist
. (Not recursive on TIO.)
Ends a list. Optional at the end of the program.
-
Range(int)
. Returns the range [0, value). -
Range(int, int)
. -
Range(char, char)
. -
CycleChop(iterable, int)
. Cyclically extends or truncates the iterable to the given length, e.g.CycleChop("12", 5)
gives"12121"
. (TIO: iterable must not be empty, even if the length is zero.)
InclusiveRange(int)
. Returns the range [0, value].InclusiveRange(int, int)
.InclusiveRange(char, char)
.
Quotes a command character, allowing it to be used as part of an ASCII string literal.
Variables. αβχφγυωψ
have preset values. ικλμνξπρςστδεζηθ
are used by loop variables, if possible. (Note that expression loops consume two variables, one for the value and one for the index.) θηζεδ
attempt to retrieve the first five inputs, if not being used as loop variables. (TIO: θηζεδ
can only be used as loop variables.)
Fill(str);
. If the cursor is in an empty space, fills that space with the given string, repeating as needed.
Begins a dictionary.
Ends a dictionary. Optional at the end of the program.
BitwiseNot(int)
.