Twoee
Jump to navigation
Jump to search
Paradigm(s) | String-rewriting paradigm |
---|---|
Designed by | Matthew Cooke,Thomas Burnip |
Appeared in | 2018 |
Dimensions | one-dimensional |
Computational class | Turing complete |
Major implementations | Python Interpreter |
Influenced by | Thue |
File extension(s) | .t2 |
Twoee because Thue isn't bad enough. This is not 100% backwards compatible. We have "improved" it.
Design Aims
Implemented
This is a comment (any text without an operator) Yes twoee has comments Replace a with b a::=b Replace a with inputed text a::=::: Replace a with b and output c a::=b~~~c Replace a with inputed text print c a::=:::~~~c This will define the data string ;;=a
Unimplemented
Proper implementation of literal and non literal operators i.e. not have such a hacky fix for making ~~~ run after :::
Operator list
All possible operators
Definition Operators
This defines a command ::= This defines the data string ;;=
Control Operator
This tells the interpreter to take an input from the user ::: Prompted input ~::Prompt This outputs the text following it (text is treated as a literal) ~~~
Example Code
This proves that our design aims have been met
This is the exmaple Twoee File. It should output: [whatever you typed first] You replaced d with e! [what ever you typed second] You replaced f with the string you typed! [What ever you typed] b[whatever you typed second]e[whatever you typed second][you final input] a::=b c::=::: d::=e~~~You replaced d with e! f::=:::~~~You replaced f with the string you typed! g::=~::Add your input? ;;=acdfg
Hello World!
a::=Hello b::= World ;;=ab
Some notes on execution
This does not chose a random possible substitution and run it, instead it will always run the first possible substitution. Therefore the order they are defined in will set their precedence.
There are a few structural changes to how files are laid out as well compared to Thue. For example the data string is no longer defined as whatever comes after a line with only ::= on it but as whatever follows the ;;= operator. All operators are 3 characters long.
Road Map
- Add file input and output
- Have a single variable that is equal to the data string
External resources
A Python interpreter is available on GitHub.