Basic Encoding


Empty lists are encoded as “0”, lists consisting of one element as “1” + the encoded element,
and longer lists as “22” + (length of list – 2 encoded as number) + encoded elements.


Numbers are encoded as list of digits; add the number of numbers with less digits as offset.

Example: “22001” is a list of 2 digits: [0,1]; the digits represent the number 1, and the offset is 1 + 3,
so “22001” represents 5.

Counting up (from 0 to 30):


Tuples are just encoded as concatenation.



A Chamber is encoded as tuple (upper pipe, isAuxchamber, lower pipe);
the pipes are a list of tank numbers, isAuxChamber is a number (either 0 or 1, encoded as “0” or “10”)


A Car is a list of chambers.



A fuel is a list of tanks, and a tank is a matrix encoded as list of rows (which are a list of numbers).


Generated using nanoc and bootstrap - Last content change: 2011-05-30 19:02