car race, best language and code?
From: Developwebsites (developwebsites_at_aol.comBATSPAM)
Date: 09/28/04
- Next message: CBFalconer: "Re: Importance of Computer Science degree?"
- Previous message: Nick Landsberg: "Re: a benefit to using a linked list in insertion sort?"
- Next in thread: TLOlczyk: "Re: car race, best language and code?"
- Reply: TLOlczyk: "Re: car race, best language and code?"
- Reply: gswork: "Re: car race, best language and code?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 28 Sep 2004 18:44:58 GMT
I have 10 cars. All have to start when the light turns green.
[Obviously, in a real race not all cars start at the same time and at same
speed]
I had tried:
repeat with loops = 1 to 100
repeat with x = 1 to 10
speed = random(20)
ver = ver - speed
sprite(x).locv = ver
end repeat
end repeat
however, this isnt realistic as cars 1-10 always run in sequence.
So...
I tried:
repeat with loops = 1 to 100
car = random(10)
speed = random(20)
ver = ver - speed
sprite(car).locv = ver
end repeat
however, this isnt realistic as only 1 car moves at a time and
the same car could move again while others are standing still.
I cant use a loop, I cant use random so
whats the best solution?
- Next message: CBFalconer: "Re: Importance of Computer Science degree?"
- Previous message: Nick Landsberg: "Re: a benefit to using a linked list in insertion sort?"
- Next in thread: TLOlczyk: "Re: car race, best language and code?"
- Reply: TLOlczyk: "Re: car race, best language and code?"
- Reply: gswork: "Re: car race, best language and code?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|