Module pibfi_tape

Description

Tape ADT for the Platonic Ideal Brainf*ck Interpreter.

Now a behaviour.

Function Index

Exported Functions
behaviour_info/1
decrement/1Decrements the value at the current position on the tape.
decrement/2Decrements the value at the current position on the tape N times.
examine/1Examines the state of the tape.
increment/1Increments the value at the current position on the tape.
increment/2Increments the value at the current position on the tape N times.
left/1Moves the read/write head one position left on the tape.
left/2Moves the read/write head N positions left on the tape.
read/1Returns the value at the current position on the tape.
right/1Moves the read/write head one position right on the tape.
right/2Moves the read/write head N positions right on the tape.
server/2
start/3Starts and returns the pid of a new tape server.
write/2Places the given value at the current position on the tape.

Exported Functions

behaviour_info/1

behaviour_info(Arg1) -> term()

decrement/1

decrement(tape()) -> ok | {error, Reason}

Decrements the value at the current position on the tape.

decrement/2

decrement(tape(), N::integer()) -> ok | {error, Reason}

Decrements the value at the current position on the tape N times.

examine/1

examine(TapePid::pid()) -> ok | {error, Reason}

Examines the state of the tape.

increment/1

increment(tape()) -> ok | {error, Reason}

Increments the value at the current position on the tape.

increment/2

increment(tape(), N::integer()) -> ok | {error, Reason}

Increments the value at the current position on the tape N times.

left/1

left(pid()) -> ok

Moves the read/write head one position left on the tape.

left/2

left(pid(), N::integer()) -> ok

Moves the read/write head N positions left on the tape.

read/1

read(pid()) -> integer()

Returns the value at the current position on the tape.

right/1

right(pid()) -> ok

Moves the read/write head one position right on the tape.

right/2

right(pid(), N::integer()) -> ok

Moves the read/write head N positions right on the tape.

server/2

server(Arg1, Arg2) -> term()

start/3

start(module(), Supervisor::pid(), [option()]) -> pid()

Starts and returns the pid of a new tape server. For a description of the allowed options, see the documentation for the pibfi module.

write/2

write(tape(), integer()) -> {ok, integer()} | {error, Reason}

Places the given value at the current position on the tape.