Skip to content

Repository files navigation

Welcome to Abacus-Lang

This was inspired by Brain Fuck.
Like BF instructions are single characters and are very limited.
However in theory this is turing complete.

Explained

Memory

Memory composes of Rods, which hold Beads.
By default (const unsigned int LeftStart = 10) each Rod starts with 10 Beads on the left,
These can only be shifted from one side of the Rod to the other.
NEVER creating going above the initial 10 Beads total on the Rod.

Note

This means the code cannot overflow or underflow, so you may end up with values capping at LeftStart or 0!

Instructions

Char Effect
> Move a bead from Left to Right
< Move a bead from Right to Left
U Go Up a Rod
D Go Down a Rod
L Do if Left NOT 0
R Do if Right NOT 0
] End of if
T Display Memory
Console R/W coming soon

Notation

Rod 0 = R0
Rod 0 Left Beads = R0L
Rod 0 Right Beads = ROR

So for Rod 1
R1, R1L, R1R respectively

Examples

Add 2 Values

Assuming the 2 rows are sequential (R0, R1)
DR<U>D]
This loops until the Right beads of the R1 is 0
Each time R1R-1 and then R0R+1

Multiplying 2 Values

Assuming the 2 rows are sequential (R0, R1)
R<UR<DD>D>UUU]DDR<UU>DD]U]
R1R-1
Destructively duplicates R0 into R2, R3
Copies R2 back to R0
This loops till R1R==0
Hence R3 will become the multiplied sum

Fibinachi Sequence

>>>>>>>DD>UURDDRD]UR<D>D>UU]DDR<UU>DD]UUUR<DD>D>UUU]DDDR<UUU>DDD]URU]U]T

About

Esoteric Language Using an Abacus as memory

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages