EXCON

From Esolang

Jump to: navigation, search

EXCON is a lame abbreviation for EXclamation mark COloN and was designed by Emil Svensson (fr34k) in 2008.

Contents

[edit] Overview

Initially EXCON has one pool with 8 binary digits, all set to 0 and a pointer set to the right-most digit in the pool.

[edit] Commands

Command Function
: Reset all digits in the pool to 0
^ Flip the digit at the pointer
! Output the pool
< Move the pointer to the left

[edit] Examples

Initially, we start out with an empty pool, with the pointer pointing at the right-most digit

00000000
       ^

(the above code is just for clarification, and is not actual source code)

If we want to write the letter A, which in binary is 01000001, we must flip the first and the seventh bit. Like this

:         Reset the pool (this is optional at the beginning of a program)
^         Flip the first bit (making it 1)
<<<<<<    Move 6 steps to the left
^         Flip the 7th bit
!         Output the pool (A or in binary 01000001)

EXCON treats all other characters than ':', '^', '<' and '!' as comments. The above program can be written like this as well

:^<<<<<<^!

Notice that we don't have to move to the eight bit, since this remains 0, we don't have to do anything with it.

Note: If you move the pointer more than 8 steps, the program will take this as a fault operation, since all ASCII characters converted to binary consists only of 8 digits.

[edit] Hello, World!

:<^<<^!:<^<^<<^<^!:<^^<^^!!:<^^<^^^^!:<<^!:<^<^<^^^!:<^^<^^^^!:<^^^<<^!:<^^<^^!:<^^<<^!:<<^<<<<^!

Above code would output in ASCII

Hello World!

or in binary

010010000110010101101100011011000110111100100000010101110110111101110010011011000110010000100001
Personal tools