I was wondering if anyone knows a way to have a procedure happen exactly 50% of the time. I'm not taking about using prob(50) or pick(A,B) or whatever.
For example I'd like a projectile to move 2 steps, then create another object. Any ideas?
ID:155075
Sep 26 2011, 2:51 pm


#1 Sep 26 2011, 3:04 pm


Modulus!

Kaiochao wrote:
Modulus! > for(var/n in 1 to 10) 
Check the DM Reference entry for the % operator. It simply gives the remainder of A divided by B.
In the example I provided, it checks if A%B is 0, which is the case in even numbers divided by 2. 
Kaiochao wrote:
Check the DM Reference entry for the % operator. It simply gives the remainder of A divided by B. Alright but not all even numbers divided by 2 equals 0 so the example doesn't really work unless I'm missing something. 
Name a single even number that, divided by 2, leaves a remainder that is not 0.

#6 Sep 26 2011, 5:46 pm
In response to Robertbanks2 (#5)


Robertbanks2 wrote:
Name a single even number that, divided by 2, leaves a remainder that is not 0. Sorry, I misunderstood. I saw the % operator as solely giving the quotient of two numbers. Then I read again and found that it gives the remainder. As for your example Kaiochao, it's correct. Thanks:) 