A?!

From Esolang
Jump to navigation Jump to search

A?! is a minimalistic esoteric programming language, created by User:Someone else.

Description

There can be created alphanumeric variables that contain boolean values. There are input and output streams, that both operate in ASCII. Input is streamed in little endian, and output is in big endian.

Syntax Function Notes
<variable>! Flips specified variable.
<variable>? Skips next instruction if specified variable is false. Comment don't count as instructions.
<variable>. Sends the value of specified variable the output stream. Letter is only printed when all 8 bits are specified. The program won't fill in zeroes if 8 bits aren't reached, and will throw an error.
<variable>... Gets one bit from the input stream and puts it in the specified variable. Realtime input is supported. If it's called again after EOF, the program halts.
>>>...> Jumps forward the same amount of instructions as there are > in a row. Counts as one instruction.
<<<...< The same thing as >, but backward. > and < can't be mixed together. It wouldn't make sense anyway.

Everything between a # and a newline is a comment. A newline is required after every instruction. Additional newlines are ignored.

Computational class

There is only 62 alphanumeric variable names. And that's including case-sensitivity. Considering that they are all just bits, this language is hardly useful for computation. If we get rid of this limitation, the computational class would be a finite-state automata, because there is no relative addressing, cell values are finite, but flow control is still possible.

Examples

Truth machine

A...
B...
C...
C...
C...
C...
C...
C...
A.
B.
B.
A.
A.
A. 
A.
C.
C?
>
>>>>>>>>>
A.
B.
B.
A.
A.
A. 
A.
C.
<<<<<<<
#Pretty sure there is a more optimized way, but i'm too lazy

Infinite loop

>
A! #This instruction will never be executed.
<

Cat program

A...
B...
C...
D...
E...
F...
G...
H...
A.
B.
C.
D.
E.
F.
G.
H.
<<<<<<<<<<<<<<<<

Increment a single-digit number: (wrap around)

#Input
A...
B...
C...
D...
E...
F...
G...
H...

#Increment
H?
>
>>>>>>>
G?
>
>>>
F?
E!
F!
G!
H!

#Wrap-around
E?
>
>>>>>
G?
>
>>
E!
G!

#Print
A.
B.
C.
D.
E.
F.
G.
H.

See also