It's time to really blow your mind
The world David created is much more then the 60 levels that are currently supported. However, I think the concept of levels & stars only goes up to a certain point, because then machines get so big it starts being very un-fun to try to minimize them. But still fun to build them and use them as building blocks for even more complicated machines. What follows here is the most complicated machine I built so far, a "memory unit". This machine also convinced me that eventually every computable function can be solved in this world.
It uses building blocks itself that are actually levels, and I replaced them by some of my older / less efficient implementations just not to spoil levels for others.
Since the language this machine is written in isn't very readable (mild understatement), and I can't add comments inside, I'll try to explain it here in English. Probably quite a long/tough read to get though.
First of all,
here is the machine I'm talking about.
TreeMem, the main component, understands two kind of input instructions:
<address>Yellow<value>Yellow | writes <value> on <address> |
<address>Green | read <address> |
Both <value> and <address> are sequences of blue & red of any length.
Tree Mem consists of a single Tree Node, the root of the tree.
Tree Node has several sub components:
State Machine, which is complicated.
List Store, used to store the value at this node.
Two copies of Tree Node, one to store everything at current-address+blue and one for current-address+red.
direct4, which is used to direct balls that come out of the State Machine to either the list store or one of the sub-nodes.
(the fourth direction is never used, but it was easier to re-use an old component then to create a direct3)
State Machine can output balls to the right to determine where data is going, and output actual data on the bottom.
State Machine has another direct4 inside, because it can be in one of 4 states.
When a ball comes in from the left, it's passed onto the current state.
Whenever any state outputs a ball up, this changes the state of the state machine
Whenever any state outputs a ball right, this comes out of the right side of the state machine, thus determining where the data is going
Whenever any state outputs a ball down, this comes out of the down side of the state machine, thus it is considered data.
direct4 is also known as level 53. A ball from the right determines where balls from the left are going. blue=right, red=up, yellow=left, green=down.
This one contains 3 instances of direct2, uses 9 tiles more then necessary and isn't very pretty. But hey, it works.
List Store can remember a sequence of red/blue balls. A green ball reads, a yellow ball resets. It uses a lot more tiles then 'List', but that's because you can read this one multiple times without destroying the data.
State Ready (blue) represents the default state.
When a green ball comes in, we should read (green down) our local (yellow right) value. Then we're ready again.
When a yellow ball comes in, we should reset (yellow down) our local (yellow right) value. Then we start writing (green up)
When a red/blue ball comes in, we should pass subsequent balls to the correct sub-node (red/blue right). Apparently we're now parsing an address (yellow up).
State Write (green) implies we're writing to our local List Store.
When a blue/red ball comes in, we pass it as data.
When a yellow ball comes in, we're done writing and go back to ready state (blue up)
State Address (yellow) means we're currently parsing an address.
Whatever ball comes in, our already selected sub-node should hear about it (pass it down).
A green ball means we're done and should return to ready state (blue up)
A yellow ball means we're now going to receive a value (red up)
State Value (red)blue/red/yellow balls should be passed to our sub-node (pass it down)
A yellow ball means we're done and should return to ready state (blue up)
Bit is known as lvl 50 (Memory) and can store one bit of information (red/blue). A green ball reads without destroying the value.
BR/Y/-/G is just some convenience component I use to split up colors.
direct2 is used to build direct4 and does half the work.