/thue

A C++ implementation of the Thue language

Primary LanguageC++MIT LicenseMIT

thue: a C++ implementation of the Thue language

artwork/logo32x32.svg

Abstract

This is a C++ project of a command-line processor of John Colagiola’s Thue programming language.

Synopsis

thue [-cdlnr] [-S U] [-s N] FILE

thue [-h | --help]

thue [-V | --version]

Description

The program reads and processes the Thue code in FILE; it reads the input from stdin and prints the output in stdout. By default it follows the convention on newlines in the code proposed by Laurent Vogel.

Options

-c
leave CR at EOL as is
-d
enable the debug print
-l
enable the Left mode: priority given to the leftmost match
-n
disable the feature to print a newline by rules of form ...::=~
-r
enable the Right mode; priority given to the rightmost match
-S U
specify U as a random seed
-s N
stop after N steps at most
-h, --help
print the help
-V, --version
print the version

Examples

See the test code in files of name test/*.t.

test/incr.t
read a binary number, increment it, and print the result
test/quine.t
a Quine
test/seq.t
print an initial segment of the Thue-Morse sequence

Author

Takeshi Abe <tabe@fixedpoint.jp>

License

The MIT license