Symbols

From Esolang
Jump to: navigation, search
The title of this article is incorrect because of technical limitations. The correct title is ():;+-#?!.

():;#?! is an esoteric language created by user:lucasieks with only 9 commands.

Commands

Command Action
( Start a loop
) End a loop
: Print the character to the right of the IP
; Read a character from STDIN, then overwrite the character 2 characters to the right of the IP
+ Increment the character to the right of the IP
- Decrement the character to the right of the IP
# Read a character from STDIN then process it as an instruction
? Go to END if the character to the left of the IP is a valid instruction
! END the program

Examples

Hello World

:H:e:l:l:o:,: :w:o:r:l:d:!

Cat

(;: )

Interpreters

Javascript

var code=prompt();
var output="";
var end=false;
for(var i=0;i<code.length;i++){
  switch(code.charAt(i)){
    case")":
      while(code.charAt(i)!=")"){i--;}
      break;
    case":":
      output+=code.charAt(i+1);
      break;
    case";":
      code.charAt(i+2)=prompt();
      break;
    case"+":
      code.charAt(i+1)=String.fromCharCode(String.charCodeAt(code.charAt(i+1))+1);
      break;
    case"-":
      code.charAt(i+1)=String.fromCharCode(String.charCodeAt(code.charAt(i+1))-1);
      break;
    case"#":
      code.charAt(i)=prompt();
      i--;
      continue;
      break;
    case"?":
      switch(code.charAt(i-1)){
        case"(":
        case")":
        case":":
        case";":
        case"+":
        case"-":
        case"#":
        case"?":
        case"!":
          end=true;
      }
    case"!":end=true;
  }
  if(end===true){break;}
}
console.log(o);