Lucky Ball

From Esolang
Jump to navigation Jump to search

Lucky ball is an esolang created by User:RainbowDash, where you link objects together and delink them.

There are commands that can be appended together.

a&b links two variables.
a-b delinks two variables.
a?b (if true code : optional if false) if linked then execute code.
goto label gotos label
print c prints c and everything it's connected to

example

increment binary to encode a binary number we can represent it like so

a&d > 1
b&e > 1
c&f > 1

or

a&d > 1
b   > 0
c&f > 1

then to increment it once we can do this.

a
b
c

c?f (c-f, goto carry_b : c&f, goto end)

carry_b:
b?e (b-e, goto carry_a : b&e, goto end)

carry_a:
a?d (a-d, goto overflow : a&d, goto end)

overflow:
a-d
b-e
c-f

end:
print a
print b
print c