• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

modulo

  1. Daniel Mallett

    Modulo issues

    I am trying to get the modulo of negative numbers. I.E -1 MOD 28 . I'm expecting to get the answer 27. But I get the result -1. Does anyone know why this is? show_message(-1 mod 28); = -1 WRONG show_message((-1) mod 28); = -1 WRONG show message(1 mod 28); = 1 CORRECT I'm lost.
  2. Papa Doge

    SOLVED Issues with mod function in for loop

    I'm definitely scratching my head with this one and not sure why it's failing: for (var l=1; l<((bc*br)+1); l++;) { biome_grid_positions_list[| l] = [bx, by]; if (l mod bc == 0.00) { bx = x; by += cell_size; show_debug_message("Wrapping here at column " +...
  3. Coded Games

    (SOLVED) Modulo weirdness: -1 % 5 == -1?

    Likely a stupid question by why does -1 % 5 == -1. I thought it should be 4. I even checked on Wolfram Alpha to make sure I wasn't going crazy. I remember having this problem in the past but I don't remember how it was fixed.
Top