INCAL

From Esolang
Jump to navigation Jump to search

INCAL is an esoteric programming language by (presumably) User:Zzo38.

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

Commands

send Send to output
receive Receive from input
store Store value in a variable
call Call a subroutine
return Return from a subroutine call
record Start recording changes of variables
stop Stop recording
rewind Rewind recording and put variables recorded to old values
accept Accept new values of variables and remove old value from recording
forget Discard entries from call stack
echo Echo a normalized form of a value to output
die Stop program
string Create string for using with $ operator
erase Erase a recording
object Create object
enter Enter an object code
exit Exit from an object code
bits Tell the bits of a number to the output
edit Self-modifying code

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+@@@@@@@

External resources