~GaLs~
† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
- Reaction score
- 180
I'm bad in math, how should I optimize this code?
JASS:
private function GetDumLvlFrmDist takes real dist return integer
if dist <= 200 then
return 1
elseif dist >200 and dist <= 400 then
return 2
elseif dist >400 and dist <= 600 then
return 3
elseif dist >600 and dist <= 800 then
return 4
elseif dist >800 and dist <= 1000 then
return 5
elseif dist >1000 and dist <= 1200 then
return 6
elseif dist >1200 and dist <= 1400 then
return 7
elseif dist >1400 and dist <= 1600 then
return 8
elseif dist >1600 and dist <= 1800 then
return 9
elseif dist >1800 and dist <= 2000 then
return 10
endif
endfunction