+ push i + columns[col_num].height + fw_other
+ # will be dereferenced later
+ space.neighbors = neighbors.clone() # FIXME ?remove ``.clone()``
+ col_offset += column.height
+ # convert all space.neighbors arrays from containing space ids to referencing the space
+ for s in spaces
+ for id, key in s.neighbors
+ s.neighbors[key] = spaces[id]
+
+# support obsolete save data format
+load_game_0 = (encoded) ->
+ letters = (encoded.substr 0, num_spaces).split ''
+ for l in letters
+ new_letter_queue.push {
+ letter: l,
+ hp: 1 + Math.floor(Math.random() * (HP_MAX - 1))
+ }
+ score = parseInt(encoded.substr(num_spaces), 10)
+
+load_game_1 = (encoded) ->
+ int = 0
+ encoded = encoded.substr 1
+ score = parseInt(encoded.substr(num_spaces * 3 / 2), 10)
+ for t in [0...(spaces.length * 3 / 2)] by 3
+ int = 0
+ for d in [0...3]
+ int *= 44
+ char = encoded[t + 2 - d]
+ int += save_charset.indexOf(char)
+ t2hp = int % 11
+ int = Math.floor(int / 11)
+ t2letter = String.fromCharCode(char_a + (int % 26))
+ int = Math.floor(int / 26)
+ t1hp = int % 11
+ int = Math.floor(int / 11)
+ t1letter = String.fromCharCode(char_a + (int % 26))
+ new_letter_queue.push {
+ letter: t1letter,
+ hp: t1hp
+ }
+ new_letter_queue.push {
+ letter: t2letter,
+ hp: t2hp
+ }
+
+load_game = (encoded) ->
+ switch encoded.substr 0, 1
+ when "1"
+ load_game_1(encoded)
+ else
+ load_game_0(encoded)