Thue resources | 2003-08-08 [ EN | FR ] |
IntroductionThue is an esoteric language invented by John Colagiola in 2000. The Thue web pages tend to grow scarce these days, so I've included copies of material initially found on the web before it disappeared. DescriptionHere is a short description of the language. Refer to the Thue reference manual in the original distribution for more details. A Thue program consists of two parts: the rule base and the initial data. The rule base is a list of rules expressed in the form: <left-hand-side>::=<right-hand-side> where the left hand side (LHS) and right hand side (RHS) are strings of characters. The line ::= separates the rule base from the initial data; The initial data is the string of characters resulting from the concatenation of all subsequent lines, omitting the <newline> characters. Thue works by repeatedly picking at random a rule whose LHS string is contained in the current data, and replacing the LHS by the RHS. The program stops when no rule can match. Input/outputInput/output is allowed by the following primitives:
NewlinesThe Thue reference manual is not very clear about newlines in input/output. Existing Thue interpreters tend to output a newline after each output rule is triggered. However this prevents writing Thue programs which need a finer control on the output (like self-reproducing programs that output exactly their own code). I propose a variant of Thue where:
With this convention, nice programs like quines and 99 bottles of beer can be written. DownloadOriginal resources
HomemadeAll programs below assume the output variant described above.
Links
| |
[Home] Contents News [STonC] STonC Screenshots [Sed] Sed [Esoteric] Thue [Minix] Minix [Misc] Misc |
|
(C) 2003 - Laurent VOGEL<lvl@club-internet.fr>
|