My attempt at trees
I already have two proposals, and I want to get some feedback, but I think I simplified trees enough to make it workable and not too complex.
The Monkey Tree is an endless tree made of Nodes. Each Node has one parent node and two children node and is referred to by its row and rank in the form row.rank. For nodes with row I, only nodes with rank 2 ^ (I – 1) exist. (So the node 2.5 does not exist).
The parent of node I.J is node I-1.J./2 (when odd, J/2 is rounded up).
The children of node I.J are the nodes I+1,2J and I+1,2J-1. (So the parent of the node 3.4 is 2.2, and the children of the node 3.4 are 4.7 and 4.8).
The node 1.1 is called the root node and does not have a parent node.
When a monkey joins the monkey tree they are added to first empty row with the lowest row, lowest rank is used to break ties. (3.3 is picked before 4.2 as 3 is less than four. 4.2 is picked before 4.4 because 4 equals 4 and 2 is less than four).
The monkey tree is unbalanced if a monkey is in a node and there is no monkey in that node’s parent. (provided that the node is not 1.1 of course), or if there is more than one monkey in the same node.
If a monkey is in a node and there is no monkey in that node’s parent, then the monkey simply moves to the parent node.
If there are two monkeys in the same node then the monkey’s whose name appears later alphabetically moves to the lower of the two children of that node. The exception to this rule is if the lower of the two children already contains a monkey and the greater of the two children does not, in this case the lower alphabetically monkey moves to the greater of the two children. (So if Monkey A and B are in node 4.5 and monkey C is in node 5.9, then monkey B would move to node 5.10. If monkey D is already in node 5.10, then monkey B would move to node 5.9 even if 5.10 has no children and 5.9 has both).
When displaying the monkey tree, only nodes containing monkeys should be displayed.
Icarus:
We’re going to have some very confused monkeys, but I like it.