
-----------------------------------
Matt_872000
Tue Jun 07, 2005 10:36 am

False, but only on every other iteration...
-----------------------------------
How would I make it so that a boolean variable is false on every odd iteration of an infinite loop?

-----------------------------------
Tony
Tue Jun 07, 2005 10:50 am


-----------------------------------
if i is your counter then
boolean:= (i mod 2 = 0)

-----------------------------------
[Gandalf]
Tue Jun 07, 2005 3:49 pm


-----------------------------------
Woah...  How would that work?  An explanation please.

-----------------------------------
Tony
Tue Jun 07, 2005 4:56 pm


-----------------------------------
I'll just show you a sample

for i : 1 .. 10
    put "iteration value: ", i, " -- boolean value: ", i mod 2 = 0
end for

The problem asks for boolean value to be false for odd numbers. Which translates into true for even numbers. Even numbers are defined as having a remainder of 0 when divided by 2.
