Pointy

From Esolang

Jump to: navigation, search

Pointy is a language by Ihope127. The basic datatype is the pointer.

Contents

[edit] Instructions

The instructions:

LBL foo: not really an instruction, but marks a destination for a DEC jump.
CPY x y: stores the value x in memory location y.
INC x: increments the value at memory location x.
DEC x foo: tries to decrement the value at memory location x. If x already held 0, jumps to foo.
OUT x: outputs x.
INP x: inputs a value into the memory location x.

Pointers can be dereferenced using the * operator: *x is the value at location x. Since there is a memory location 0 (there is no null pointer), * never fails to produce a result.

[edit] Examples

Hello, World!

CPY 108 1
CPY 111 2 
OUT 72
OUT 101
OUT *1
OUT *1
OUT *2
OUT 44
OUT 32
OUT 119
OUT *2
OUT 114
OUT *1
OUT 100
OUT 33

Cat program

LBL start
INP 0
OUT *0
DEC 1 start ; the value at 1 will be 0, so this jumps to start

[edit] Computational class

Pointy is Turing-complete because it can simulate a Minsky machine. It can also emulate Brainfuck with a tape that extends infinitely only to the right.

[edit] External resources

Personal tools