Noit o' mnain gelb

noit o' mnain gelb is a two-dimensional probabilistic cellular automaton based on Brownian motion. It is heavily inspired by noit o' mnain worb, and it is named after that automaton and the German word for "yellow".

At any given time, the gelb universe consists of a two-dimensional grid. Every square of the grid has exactly one of six materials: rubber (#), metal (space), arsenic, boron (.), copper (+), or zinc (-). In addition, every square may or may not contain one object. The two types of objects are holes (^) and electrons (*).

Each tick, a random object is selected, and a random one of the eight adjacent squares is selected. Assuming the object is a hole, what happens is as follows:


 * If the adjacent square is occupied:
 * by a hole, nothing happens.
 * by an electron, both the hole and the electron vanish.
 * If the adjacent square is unoccupied, and made of:
 * rubber or zinc, then nothing happens.
 * metal, arsenic, or copper, then the hole moves into the square.
 * boron, then the hole moves into the square if this would result in it being adjacent to an electron.

In any case, if the hole left an unoccupied copper square behind, and that copper square is adjacent to at least one unoccupied zinc square, then a new hole is created on the copper square, and a new electron is created on a random unoccupied zinc square adjacent to the copper square.

The behavior of an electron is the same as that of a hole, except with "arsenic" swapped with "boron", "copper" with "zinc", and (of course) "hole" with "electron".

The following ought to act like a diode, allowing electrons to pass from left to right (and holes from right to left) but not vice versa:

+- .....,,,,, +-     .....,,,,,         .....,,,,,

Normally, the only way for charge to move from one half of the diode to the other is for an electron on the left side to cancel out a hole on the right side. It's possible for an electron to migrate into the arsenic, or a hole into the boron, but ideally, they won't get very far before being canceled.

This one should act like an NPN transistor:

+- .....,..... -+    .....,.....     .....,.....         # #

If there are no holes entering the transistor at the bottom, then it is unlikely that any holes will be able to enter the arsenic in the center. Since there are no holes in the arsenic, it won't pass electrons, so current will not be able to flow from left to right or vice versa. If holes do enter the bottom, however, electrons will be able to pass across the arsenic. Of course, some holes will be consumed in the process; this transistor's gain may be so small that it is useless.