I'm puzzled as to how I would "countdown" so to speak through odd integers. If I'm not making much sense; I'm trying to count from 3 to any infinite number that's odd. For example:
3 (add odd number
5
7
9
11
13
15
17
19
21
23
25 etc.
What would be the best approach? I'm aware I can use the % operator to determine if the value is an odd number but so far that knowledge hasn't helped me much. I'd appreciate the help!
edit: I realize adding 2 to 1 and adding 2 to 2+1 could create the effect I need, but that's not quite working very well!
ID:151486
Aug 29 2010, 12:14 pm (Edited on Aug 29 2010, 1:58 pm)
|
|
Aug 29 2010, 12:31 pm
|
|
What I'm doing here is trying to add to world.maxz and create one type of object in every odd Z level and another type of object ito every EVEN Z level. Hope that clears up any questions.
|
m not exactly understanding your question very well, do you want a wy to count down using odd numbers or do you...yea
|
In response to Duelmaster409
|
|
uhhhh
proc |
In response to Duelmaster409
|
|
Duelmaster409 wrote:
What I'm doing here is trying to add to world.maxz and create one type of object in every odd Z level and another type of object ito every EVEN Z level. Hope that clears up any questions. I would assume that there is a more efficient way to accomplish this, but this is the route I have come up with. proc/OddCount(maxn) |
In response to RJTaylor
|
|
This isn't really what I was asking for. All you're doing is simply creating a for() loop that stops at 25 (which by the way, you don't need to create a variable for). But I can see how this could be applied to my situation with some thought.
|
Just because a loop increments by 2, doesn't mean you can't use the numbers in between that:
proc/SpawnThings() I'm assuming you want it done all at once, without any delay? |
In response to DarkCampainger
|
|
No, what I'm doing is creating one at a time. When the object is created it is stored in a list. The list's .len acts as a way to determine which Z level is "selected". This works fine with even numbers but I can't quite get this to work with odd numbers.
|