-
Notifications
You must be signed in to change notification settings - Fork 10
Tutorial
There are many flags you can use to specify how you want to use Charcoal.
Name | Short form | Succinct mode | Verbose mode |
---|---|---|---|
Integer | int |
A run of ⁰¹²³⁴⁵⁶⁷⁸⁹
|
A run of 0123456789
|
String | str |
A run of ASCII printables ( to ~ ), or a compressed string (more about this later) |
A string delimited with " or ' , processed with Unicode unescaping |
Variable | var |
One of αβγδεζηθικλμνξπρσςτυφχψω
|
One of abgdezhciklmnxprstufko
|
Literal | lit |
An int , str , or var
|
An int , str , or var
|
Arrow | arw |
One of ←↑→↓↖↗↘↙
|
One of :Left , :Right , :Up , :Down , :UpLeft , :UpRight , :DownLeft and :DownRight . |
Command | cmd |
See Command. | See Command. |
Operator | op |
See Operator. | See Operator. |
Dyad | dy |
A dyadic operator. | A dyadic operator. |
Monad | mn |
A monadic operator. | A monadic operator. |
Nilad | nl |
A niladic operator. | A niladic operator. |
Expression | exp |
A lit , lst , dy exp exp , mn exp , or nl
|
|
Body | bdy |
A command, or multiple commands surrounded by «»
|
A command, or multiple commands surrounded by {}
|
List | lst |
A list of lit , delimited by ⟦⟧
|
|
Arrow list | als |
A list of arw , delimited by ⟦⟧
|
|
Separator | sep |
¦ |
One of ,;
|
Separators can be placed after any literal, i.e. an int
, str
, or var
.
Strings delimited by “”
are compressed strings. This means they are ASCII strings converted from base 96 or under (the 95 printables and newline) to base 255 (the full 8-bit codepage minus ”
). The first character in the string is the encoded character for the base.
Strings delimited by ””
are permuted compressed strings. This means they are ASCII strings converted from base 96 or under to base 255. The first character in the string is the encoded index of the permutation number, the second is the encoded character for the base.
The default order of the ASCII character set is whitespace, symbols, lowercase letters, numbers, and uppercase letters. An index is generated based on the number of uses of each type of character using this order as the base.
Pretty simple. In succinct mode it's just <command><arguments : var>
, in verbose mode it's just <command>(<arguments : var>)
. See more [here|Commands].
There are three kinds of control flow statements:
¿<condition : exp><if_true : bdy><if_false : bdy>
F<iterable : exp><body : bdy>
W<condition : exp><body : bdy>
HF<delay : exp><iterable : exp><body : bdy>
HW<delay : exp><condition : exp><body : bdy>
if (<condition : exp>) <if_true : bdy><if_false : bdy>
for (<iterable : exp>) <body : bdy>
while (<condition : exp>) <body : bdy>
RefreshFor(<delay : exp><iterable : exp>_<body : bdy>
RefreshWhile(<delay : exp><condition : exp>)<body : bdy>