Warcraft III resources & community, 2003–2006 · archived

EncodeInt

not rated
Submitted by AIAndyCalculations0 downloads
Encodes val in the integer bf at position bit_num.
Uses DecodeInt and IntExp.

Source

function EncodeInt takes integer bf, integer bit_num, boolean val returns integer
  if DecodeInt(bf, bit_num) != val then
    if val then
      return bf + IntExp(2, bit_num)
    else
      return bf - IntExp(2, bit_num)
    endif
  endif
  return bf
endfunction

Comments

0

No comments.