sub MapRange(s, a1, a2, b1, b2) return b1+(s-a1)*(b2-b1)/(a2-a1) end sub for i = 0 to 10 step 2 print i, " : ", MapRange(i,0,10,-1,0) next