I was looking over some code in Jass, and was wondering how this would work.
Code:
function SaveLoad_Id2CId takes integer n returns integer
local integer i = n / (256 * 256 * 256)
local integer r
set n = n - i * (256 * 256 * 256)
set r = udg_SaveLoad_Compress[i]
set i = n / (256 * 256)
set n = n - i * (256 * 256)
set r = r * 64 + udg_SaveLoad_Compress[i]
set i = n / 256
set r = r * 64 + udg_SaveLoad_Compress[i]
return r * 64 + udg_SaveLoad_Compress[n - i * 256]
endfunction
If I set n to lets say, 35, wouldn't it just divide it by 256 cubed, set n to 0 based on the math it created, set i to 0, then set n to 0 overwriting its 0 again, set i to 0 again also, and just defeat the purpose of the second set of set i and n's that set them to 0 a second time. Or does it set them, and when it reaches a set r, redoes the local's and goes back to where it left off?