Charcoal
Jump to navigation
Jump to search
Paradigm(s) | Unknown |
---|---|
Designed by | ASCII-only |
Appeared in | 2016 |
Dimensions | One-Dimensional |
Computational class | Turing-complete |
Major implementations | Interpreter |
Influenced by | None |
File extension(s) | .cl , .clv , .clg |
Charcoal is an ASCII-art oriented prefix golfing language designed by the Programming Puzzles and Code Golf users DLosc and ASCII-only. The name is derived from the fact that it has a focus on ASCII art, which is composed of characters.
Description
Tutorial
Main article: Charcoal§Tutorial
Literals
There are two basic types of literals: strings and numbers. A string is just a run of printable ASCII, and a number is just a run of the superscript digits ⁰¹²³⁴⁵⁶⁷⁸⁹.
Examples:
foo
is equivalent to "foo"
foo¶bar
is the same as "foo\nbar".
¹²³⁴
evaluates to the number 1234.
Printing
In a Charcoal program, expressions are implicitly printed. Numbers print a line, and arrows can be used to specify a direction.
Examples:
foo
prints foo
foo⁴
prints foo----
foo↖⁴
prints:
\ \ \ foo\
Sample Code
Hello, World!
Hello, World!