Basic Encoding
Lists
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
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):
[“0”,“10”,“11”,“12”,“22000”,“22001”,“22002”,“22010”,“22011”,“22012”,“22020”,“22021”,“22022”,“2210000”,
“2210001”,“2210002”,“2210010”,“2210011”,“2210012”,“2210020”,“2210021”,“2210022”,“2210100”,“2210101”,
“2210102”,“2210110”,“2210111”,“2210112”,“2210120”,“2210121”,“2210122”]
Tuples
Tuples are just encoded as concatenation.
Structures
Chamber
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”)
Car
A Car is a list of chambers.
[([Integer],Integer,[Integer])]
Fuel
A fuel is a list of tanks, and a tank is a matrix encoded as list of rows (which are a list of numbers).
[[[Integer]]]