I'm working on a keno game for a school project that lets you play multiple consecutive games and tallies the results. i.e. if you play the same 7 numbers for 1000 consecutive games, how many times do you hit 7, 6, 5, etc. and calculates winnings and losses. I have two little problems...
1: While the code is executing, say 1000 games, I can't figure out how to stop it with a button.
2: Kind of related to 1, I have a delay slider that speeds up or slows down the play, but I want it to be "on-the-fly." Right now, you can only change the delay between games. Also, I want the delay to be from 0 to 2 seconds in .1 second increments (easy enough with the slider) What's not easy is if I set the slider to .5 seconds or below, there is no delay, and from .5 to 1 second, the delay is 1 second. I'm using
delay = slider.value
t = timer
do while timer - t < delay
I've also used
delay = slider.value
for t = 1 to delay
next t
but that's tough to regulate in relation to time.
Is there a way to just say... Delay = .2 seconds?
Any help would be appreciated.
Thanks.
1: While the code is executing, say 1000 games, I can't figure out how to stop it with a button.
2: Kind of related to 1, I have a delay slider that speeds up or slows down the play, but I want it to be "on-the-fly." Right now, you can only change the delay between games. Also, I want the delay to be from 0 to 2 seconds in .1 second increments (easy enough with the slider) What's not easy is if I set the slider to .5 seconds or below, there is no delay, and from .5 to 1 second, the delay is 1 second. I'm using
delay = slider.value
t = timer
do while timer - t < delay
I've also used
delay = slider.value
for t = 1 to delay
next t
but that's tough to regulate in relation to time.
Is there a way to just say... Delay = .2 seconds?
Any help would be appreciated.
Thanks.