CHAPTER 7
Code Explanation
var lsname;^for
(i=0;i<document.gf.level.length;i++) {Iterate through the radio buttons in the gf
form, level groupif (document.gf.level[i].checked) { Is this radio button checked?lsname=
document.gf.level[i].value+"maze";If so, construct the local storage name using
the value attribute of the radio button elementbreak; Leave the for loop} Close if} Close forswalls=localStorage.getItem(lsname); Fetch this item from local storageif (swalls!=null) { If it is not null, it is good datawallstgs = swalls.split(";"); Extract the string for each wallwalls = []; Removes any old walls from walls arrayeverything = []; Removes any old walls from everything
arrayeverything.push(mypent); Do add the pentagon-shaped token called
mypent to everythingfor (i=0;i<wallstgs.length;i++) { Proceed to decode each wall. The remaining
code is the same as the all-in-one application.sw = wallstgs[i].split("+");sx = Number(sw[0]);^sy = Number(sw[1]);^fx = Number(sw[2]);^fy = Number(sw[3]);^