?!

From Esolang
Jump to navigation Jump to search

?! is an esolang, invented by User:None1. It has only 2 commands, but it is still Turing complete.

Commands

Just like its name, ?! has only 2 commands, which are ? (question mark) and ! (exclamation mark).

Because it has only these two commands you can interleave it with brainfuck or oOo CODE.

Execution

! command

Every ! command is interpreted as one of the command in brainfuck, which is called the "current command", the current command is initially +.

? command

Switch current command to the command right after the current command in +-,.<>[], each time the ? command is executed, It changes how ?! interprets !. If the current command is ], It becomes +.

Note that in ?!, when the brainfuck ] command is executed, it changes back to [ if the condition to jump is satisfied.

Example Programs

Cat Program

!??????!????!?!????!

Explaination

! Execute +
?????? Switch command to [
! Execute [
???? Switch command to ,
! Execute ,
? Switch command to .
! Execute .
???? Switch command to ]
! Execute ]

Hello World

!!!!!!!!??????!???????!???!!!!??????!???????!???!!?????!???!!!?????!???!!!?????!???!????!!!!?????!??????!??????!???!?????!???!
?????!????!????!!???!??????!??????!???!?????!?????!??????!??????!!??????!??!????!!!??!?????!!!!!!!???!!?????!!!???!??!!??????!
?!?????!??!?!???????!?????!!!???!??????!!!!!!??!??????!!!!!!!!??!??!!???!???!??!???!!???!

See also