Warcraft III resources & community, 2003–2006 · archived

Dec2BinString

not rated
Submitted by Aiursrage2kConversion0 downloads
Prints out binary string of integer

Source

function Dec2BinString takes integer val returns string
  local string retval = ""
  loop
    exitwhen val < 2
    set retval = I2S(ModuloInteger(val,2)) + retval 
    set val = val / 2
  endloop

  return I2S(ModuloInteger(val,2) + retval
endfunction

Comments

0

No comments.