Computer Science Canada Chances of stopping |
Author: | compudave [ Wed Nov 12, 2003 8:04 pm ] |
Post subject: | Chances of stopping |
Can anyone help me out by explaining how to incorporate a chance of stopping a count loop. For exanple how to get a counted loop to have a 50% of stopping before it reaches 10. |
Author: | Chimaera [ Wed Nov 12, 2003 8:10 pm ] | ||
Post subject: | |||
well all you really have to do is make an exit when statement with a randint
Well that's basically the code you need, but why would you WANT to stop your forloop before it hits 10? |
Author: | Karam [ Wed Nov 12, 2003 8:59 pm ] | ||
Post subject: | |||
hehe dave got it before u lol
|
Author: | nis [ Sun Nov 16, 2003 3:31 am ] | ||
Post subject: | |||
That is not a 50% chance of exiting before hitting 10 Your code has a 50% chance everytime you go through the loop I am not sure exactly what the numbers are but i think if you're going through the loop 10 times then the code should be:
|
Author: | Andy [ Mon Nov 17, 2003 6:41 pm ] | ||
Post subject: | |||
ummm
|
Author: | Mazer [ Mon Nov 17, 2003 6:51 pm ] | ||
Post subject: | |||
dodge, dodge, dodge... this isn't c++
although i'm still not sure that would be correct for having a 50% chance of exiting before reaching ten. with that code there's a 50% chance of exiting at every repetition. so... yeah... |
Author: | Andy [ Mon Nov 17, 2003 6:53 pm ] |
Post subject: | |
sutpid turing... lol |
Author: | Andy [ Mon Nov 17, 2003 6:55 pm ] |
Post subject: | |
btw, mekenzie screwed up ur dwite team name eh? ur mforce now LOL |
Author: | Mazer [ Mon Nov 17, 2003 7:01 pm ] |
Post subject: | |
what're you talking about? another dwite? |
Author: | Mazer [ Mon Nov 17, 2003 7:05 pm ] |
Post subject: | |
oh geez... why didn't anybody tell me about this?! ok, so anybody up for another EM party? |
Author: | Andy [ Mon Nov 17, 2003 7:07 pm ] |
Post subject: | |
em? whats em? and yea dwite is on wednesday this wednesday and its cuz he just signed up today lol. he accidentally gave ur team ian's team's name when submitting it |
Author: | Mazer [ Mon Nov 17, 2003 8:13 pm ] |
Post subject: | |
oh. well, i'm sure he can change it. i sure hope they update the "Teams Registered" site soon, i hear there's gonna be a team from I.H. Ateturing Secondary School participating in the contest and that one of the guys in particular on that team is really good. P.S. EM = Evasive Maneuvers. honestly, what else am i gonna be doing during the DWITE contest? |
Author: | Andy [ Tue Nov 18, 2003 7:19 pm ] |
Post subject: | |
lol u should seriously make it lan compatible and have it so we can have more than two players playing |
Author: | Tony [ Tue Nov 18, 2003 7:27 pm ] |
Post subject: | |
oh yeah, lol... have a dozen spaceships in that tiny EM screen shoot up each other |
Author: | Mazer [ Tue Nov 18, 2003 9:10 pm ] |
Post subject: | |
yeah... not in turing. it's already lagging on the school computers with just two people. but maybe... maybe it's cuz i keep using my hadoken all the time.... |