I was looking at the movement in maps page and I was a bit confused as to how the code in lines 10 & 12 (see below) worked. I understand that it takes A and B (the vertical and horizontal position variables) and adds a key press which is multiplied by a conditional that checks whether or not the next position is a space. However I don't understand the logic "16(A-1+Ans)+B" or "16A-16+B+Ans". If someone could help elaborate or explain the logic, that would be extremely helpful.
CODE:
:A+Ans(" "=sub(Str1,16(A-1+Ans)+B,1→A
:B+Ans(" "=sub(Str1,16A-16+B+Ans,1→B