Some collections of commands and certain ways of laying out paths are useful and can be reused in many situations. A computer scientist might call them patterns. Here are some of the more useful ones.
- Drive-by bonder
Placing the bonder plates directly on the spot where an atom is input is the easiest way to bond atoms. A waldo can grab one atom and 'drive by' the other input square calling Bond+ as it passes thus combining the atoms. This is useful because it means the waldo only has to grab one atom once, and so you can make rather complicated bonding patterns using only a single waldo and a simple path.
- Drive-thru bonder
If you want to increase your bond count when holding a molecule you can drive it across bonding tiles and call Bond+. Again, you never have to drop it and the path is very simple.
Of course, you can add more bonders to increase the bonds.
- Bonded extractor
Sometimes you get single atoms as input but you want bonded groups of them. The easiest way to do this is to make a waldo to grab and atom and use it to do a drive-by on the same square.
It is also useful to combine this with a drive-thru bonder to get triple bonded pairs straight from the input area.
For ultimate ease of use, a parked waldo can simplify everything even further by spamming the Bond+ command.
- Chain builder
If you receive a spordic amount of single atoms (e.g. from a sensor or mixed input) and want to build them in to chains, you can do it easily with the following structure. The waldo tries to bond to the next atom if possible, and then drops the atom and grabs it. The first atom that is moved through this will bond to nothing and then be dropped, and the waldo will leave with nothing. The second atom that arrives will bond to the first moving both of them to the right and the waldo will drop it and grab the first atom.
If you want a chain of three or more, just move the grab command further away.
- Edge detection
If you have a defense mission with control commands and you want to detect when they change rather than whether they are on or off, you can build little waldo traps. The following will hold the waldo until the control is turned on.
The following will hold the waldo until the control is turned off. This prevents machines from repeating their reactions unnecessarily.
You might also want to stack a bunch of commands together to scan for the first one that is activated.
- Counter flip flops
Flip flops can be thought of as little counters that have two states. They count to two and reset. It is useful to have counters to three, four or more. In the following examples, the lower path is only taken once the count is reached. The next three images show simple counters for three, four and five.
Any count can be achieved by wiring together a long sequence of flip flops. If the number of the counting is not prime, it will be more efficient to do it by building sequences of smaller flip flop circuits. The four-counter above is really just two single flip flops combined in this way. Both the circuits below count to six, the first by a large sequence and the second by combining a three count flip flop with a regular two count flip flop straight after.
- Backtrack
Using a flip flop, you can make a waldo travel down a dead-end path and return back then take an alternate route. At first this seems a little useless but it is in fact very helpful. It allows the waldo to make use of its space much more efficiently.