Interrobang

From Esolang
Jump to navigation Jump to search
Interrobang
Paradigm(s) imperative
Designed by User:Obuqwe
Appeared in 2024
Memory system Cell-based
Dimensions one-dimensional
Computational class Turing complete
Major implementations Carrot Console
Influenced by brainfuck
File extension(s) .itr or intr

Overview

Interrobang is a simple Tape based language aiming to balance simplicity and ease.

Symbol Interrobang
+
Increment cell at tape pointer
-
Decrement cell at tape pointer
l
Move tape pointer left
r
Move tape pointer right
[
If the current cell is 0, skip to it's closing bracket
]
If the current cell is 0, skip back to it's openning bracket
?
Input a character. It's ascii value will be put onto the cell
!
Output cell value as an ascii character
;
Input a number to the current cell
:
Output current cell as a number

Another feature is the ability to write strings and numbers directly on the tape. To write a string to the tape you just put something in quotes, and when the code pointer hit's it, it'll be put on the tape. The characters are put on in reverse order; so if you were to put "abc" onto the tape, cell 0 would be c, cell 1 would be b and cell 2 would be a. This is so it's easier to print out. The tape pointer is moved when putting strings onto it

Code Examples

Hello, World!

"Hello, World!"{!l}

This program works by printing each character untill it finds a 0, and since the tape loops around, it will find the 0 at the end of the tape.
If you wanted to have text not take up more then one cell you could very well put each character and print each individually "H"!"e"!"l"!"l"!"o"!","!" "!"W"!"o"!"r"!"l"!"d"!"!"! This works because putting a single character on the tape doesnt move the tape pointer at all.

Even or Odd

;r[l-[r1l++]-[r2l+]r]
-["Odd!"{!l}-]
-["Even!"{!l}-]

This works by taking a number input and negating it twice each loop. Within each loop it's checking if it's 0 or 1, and if it is it escapes the loop. If it's Odd it'll escape the loop with a 1, and if it's Even it'll escape the loop with a 2. These two cases easily testable with just a []

Truth Machine

;:-[+:-]

Extra Notes

  • The name of this language comes from the character "‽" which is called an interrobang. This character relates to this language as a simple cat program can be wrote as just ?!