Cohadar
master of fugue
- Reaction score
- 209
Are there binary operators in JASS?
I would be 10 times better if it was a REAL programming language.
Sometimes I feel like working in QBASIC
Nice job by phyrex1an.
Yes those are right functions.
If JASS was written properly we would have them built in in the language.
If only JASS had an asm{} command
function ModuloInteger takes integer dividend, integer divisor returns integer
local integer modulus = dividend - (dividend / divisor) * divisor
// If the dividend was negative, the above modulus calculation will
// be negative, but within (-divisor..0). We can add (divisor) to
// shift this result into the desired range of (0..divisor).
if (modulus < 0) then
set modulus = modulus + divisor
endif
return modulus
endfunction
//------------------------------------------------------------------------------
// attaches integer to a handle by using hash table
//------------------------------------------------------------------------------
function Set$NAME$$X$ takes handle h, handle s returns nothing
local integer startingHash
local integer i = ABC_H2I(h) // hashkey
set i = i - (i / HASH_SIZE) * HASH_SIZE // mod(hashkey, HASH_SIZE)
if (Value$NAME$$X$[i] == null) then
set Value$NAME$$X$[i] = s
set Key$NAME$$X$[i] = h
return
else