Releases: daniero/braingasm
The $ prefix
New features
- Added the
$
prefix which returns the value of the current cell - The
r
(random) prefix now takes up to two optional prefixes:- Without prefixes it returns a random number between 0 (inclusive) and 256 (exclusive)
- With one integer prefix n it returns a random number between 0 (inclusive) and n (exclusive)
- WIth two integers n and m it returns a random number between n (inclusive) and m (inclusive)
Minor fixes
- The
p
(parity) ando
(oddity) prefixes now work with two integer prefixes also when the last one is not an integer literal:3#p
will return1
or0
depending on whether 3 is divisible by the current tape position
New behaviour of prefixes s, p and o
Breaking changes
-
Prefix
s
now by default evaluates the current cell, not the last change of a cell:
s:
will print1
of the current cell value is negative (signed),0
otherwise -
Given an integer literal, prefixes
p
ando
will return the parity or oddity with the given integer as base:
3p:
will print1
if the current cell value is divisble by 3.
#5o:
will print1
if the current position on the tape is not divisible by 5.
New features
- Prefix
s
now itself takes an optional integer prefix:
#s:
will print1
if the datapointer has moved to the left of the original start position (i.e, the position on the tape is negative)
A bunch of new features
Breaking changes
- Registers
z
andp
now by default evaluates the current cell, instead of the last updated cell. - The
p
prefix now returns1
if the value is even, and0
if it's odd, instead of the opposite. - The cells on the tape are no longer limited to 8 bits by default; They can contain arbitrarily large values, and the values may be negative
New features
- The
o
prefix which returns1
if the given value is odd, or0
otherwise - The
s
prefix, which returns1
if the given value is negative (signed). - The
*
instruction which doubles the value of the current cell, or multiplies it with the given amount, if any - The
/
instruction which halves the value of the current cell, or divides it by the given amount, if any - the
Q
instruction which quits the program if the given parameter is non-zero - String literals! Works with instructions such as
‚
and.
- The
L
instruction which limits the tape length and makes the datapointer wrap around to the other end - Minor tweaks and techical improvements
First braingasm features
This relase contains some of the first non-brainfuck features of the
braingasm language:
- The
;
instruction, which reads an integer from the input - The
:
instruction, which prints the current cell as an integer - Instruction prefixes, which changes the number of times an instruction
is performed, or alters its behaviour. Prefixes added:- Numbers
#
, the current cell numberr
, a random number
- Registers, which are updated whenever a cell is updated and can be
used as prefixes:z
returns 1 or 0 depending on whether the new value of the cell is
zero or notp
returns the least significant bit of the new value
Fixed runtime dependencies
The runtime dependencies were goofed up. This fix makes sure everything is installed when doing gem install braingasm
Improved brainfuck features
This version of Braingasm does not come with any new language features over
standard brainfuck, but the implementation has a few changes and improvements:
- The tape length is unbound in both directions
- The values of the cells stay within the range 0 - 255 by default
- Command line options have been added for
- setting other cell sizes than the default
- turning off cell wrapping, allowing arbitrarily large cell values
- selecting input behaviour when reaching EOF.
All in all this should be quite a sturdy brainfuck implementation (but not
necesarrily a blazingly fast one)
A working brainfuck interpreter
This first version of Braingasm is a fully working brainfuck interpreter, with exactly zero
other features.