Twocoman
Jump to navigation
Jump to search
Twocoman is a worse version of BF.
Commands
0 moves mode pointer to the next mode 1 executes command at mode pointer
Everything else is a comment
Modes
x the mode you start in. does LITERALLY NOTHING but you HAVE to use it at start NO MATTER WHAT + when used 1 in this mode, increments cell at memory pointer by 1 - when used 1 in this mode, decrements cell at memory pointer by 1 . when used 1 in this mode, outputs cell at memory pointer in ascii , when used 1 in this mode, asks for input in ascii and saves it at memory pointer ? when used 1 in this mode, outputs cell at memory pointer in numbers ! when used 1 in this mode, asks for input in numbers and saves it at memory pointer [ when used 1 in this mode, BF bracket ] when used 1 in this mode, BF bracket < when used 1 in this mode, moves pointer left > when used 1 in this mode, moves pointer right
Examples
Hello, World!
This program in the binary format prints the message “Hello, World!”:
1010000001000000110000000010001000001000110010000000001000111110000000110000000000101000011000000010000111000000100100010100000001110010010000000110000110000000001110000001000000010000000100000000010111100000100000000011100100000000001111110100000011000010100000001111001001
Hex
Its hexadecimal equiparation can be yielded via
A040C02208C8023E0300286021C09140724061803810101005E08039003F40C280F24
Mode sequence
Illustrated by the sequence of its modes, we obtain:
x+[-->-[>>+>-----<<]<--<---]>-.>>>+.>>..+++[.>]<<<<.+++.------.<<-.>>>>+.
Cat program
In its binary format, a repeating cat program, which terminates on a null character input, is implemented as follows:
101000000100000000100000000001000001
Hex
Its hexadecimal reformulation applies as such:
A04020041
Mode sequence
The program's mode sequence equivalent assumes the form
x+[,.]
Truth-machine
A truth-machine is provided in the following:
100000010100000000010001000000001
In no language would I think the cat would be longer than the truth machine, but here we are.
Hex
The hexadecimal twin amounts to:
814011008
Mode sequence
The sequence of modes constitutes:
x![?]?
Interpreter
- Common Lisp implementation of the Twocoman programming language. The program amplects the capability to interpret three formats of source code: binary, hexadecimal, and immediate mode sequences.