CIOL

From Esolang
Jump to: navigation, search

CIOL is a language developed by Moon_, and is designed to be fast, and efficient, in its own way

Operations

  • p | Moves the pointer up one
  • P | Moves the pointer down one
  • + | Increases the value under the pointer
  • - | Decreases the value under the pointer
  • o | Outputs the character equivilent of the value under the pointer
  • i | takes input
  • [ | Ignored, however, ] uses this for a brainfuck like loop (like)
  • ] | Goes back until it hits a [, if it hits another ] before it hits a [, it takes one more [ to stop the loop
  • / | Pushes the value under the pointer to the register specified by the next value under the pointer (R1-R3)
  • \ | Pops the value register specified by the next value under the pointer to the value under the pointer (R1-R3)
  • a | adds R1 and R2 together and puts the result in R3
  • s | subtracts R1 from R2 and puts the result in R3
  • d | divides R1 by R2 and puts the result in R3
  • m | Multiplys R1 by R2 and puts the result in R3
  • * | Terminates the program
  • j | Jumps forward n spaces
  • J | Jumps backward n spaces
  • r | prints out the data in the source until it hits a ;
  • R | Prints out the next character in the source

Examples

First two quines, from fizzie. Initially without the R instruction:

 ​+jr++++[-p++++++++p+++++++++++++++++++++PP]p+++op+o++++++++oP[-P++p]P---------J------------------o+++++++++++++++o* this is a rather suboptimal quine here;J

And obviously much more simply with it:

 +jrR+RjRr+++++[-p++++P]p_J----[-P+++p]P-oRJ*done;J

Hello, World!

 rHello, World!;

Echo

 +++j[-oi+]

Reverse echo

 ++j[pi+]P[-oP]