INCAL

From Esolang

Jump to: navigation, search

Contents

[edit] Operators

  • # Number
  • < Copy: Copies previous operand
  • > Destroy: Destroys previous operand
  • - Variable: Get the value of a variable
  • @ Centrifuge
  • * CellularAutomaton
  • _ Store
  •  ? Skip
  •  ; String
  • ^ Recall
  •  ! Array
  • $ Swap
  • ` UnArray
  • % Execute
  • + Combine: Combines 2 8-bit values to a 16-bit value
  • [ BeginLoop
  • ] EndLoop

[edit] Commands

  • send = Send to output
  • receive = Receive from input
  • store = Store value in a variable
  • call
  • return
  • record = Start recording changes of variables
  • stop = Stop recording
  • rewind = Rewinds recording and put variables recorded to old values
  • accept = Accepts new values of variables and remove old value from recording
  • forget
  • echo
  • die = Program stops
  • string = Create string for using with $ operator
  • erase = Erases a recording
  • object = Create object
  • enter
  • exit
  • bits
  • edit = Self-modifying code

[edit] Examples

Hello World example:

send,66#111#102#<101#42#93#101#120#102#110#43#
die

Replace q with the value to check:

68#q<@* = Return 1 if non-zero, or 0 if is zero
51#q* = Bit-wise not of q
240#q* = Half value of q
170#q* = Double value of q
102#q* = Intercal XOR operator
136#q* = Intercal AND operator
238#q* = Intercal OR operator

Interleave bits of 2 8-bit values (replace X and Y with the operands):

24575#10239#4607#2175#1055#519#257#XY+@@@@@@@

[edit] External resources

Download file: http://zzo38computer.cjb.net/esoteric/incal/

Personal tools