Re: [Tutor] Sum of Scores

2007-07-30 Thread Tiger12506
> So normally, after the period is up, it would choose a new seed? or does > it repeat after the period whether or not the time has changed? It would repeat whether or not the time has changed, naturally. How would the algorithm know when the period has finished? The mersenne twister is based o

Re: [Tutor] Sum of Scores

2007-07-28 Thread Luke Paireepinart
Tiger12506 wrote: Well, I was trying to emphasize that it was, for pretty much all intents and purposes, infinite. >>> Nope-nope-nope you're wrong :-)~ >>> >> The way I understood the 'period' of the random function was that after x >> calls to the function, yo

Re: [Tutor] Sum of Scores

2007-07-28 Thread Tiger12506
>> > Well, I was trying to emphasize that it was, for pretty much all >> > intents >> > and purposes, infinite. >> >> Nope-nope-nope you're wrong :-)~ > > > The way I understood the 'period' of the random function was that after x > calls to the function, you would start getting the same pattern

Re: [Tutor] Sum of Scores

2007-07-28 Thread Luke Paireepinart
On 7/27/07, Tiger12506 <[EMAIL PROTECTED]> wrote: > > Hmmm... interesting tie to another post... > > >>> x = timeit.Timer('random.random()','import random') > >>> x.timeit(300) > 1.0161026052194018 > >>> y = timeit.Timer('random()','from random import random') > >>> y.timeit(460) > 1.000430

Re: [Tutor] Sum of Scores

2007-07-27 Thread Tiger12506
Hmmm... interesting tie to another post... >>> x = timeit.Timer('random.random()','import random') >>> x.timeit(300) 1.0161026052194018 >>> y = timeit.Timer('random()','from random import random') >>> y.timeit(460) 1.0004307810070827 Dictionary lookups do take HUGE amounts of time. Intere

Re: [Tutor] Sum of Scores

2007-07-26 Thread Luke Paireepinart
Tiger12506 wrote: >> bhaaluu wrote: >> >>> Greetings, >>> >>> Beautiful! Thank you SO much for all the variations. >>> I'm so sure I'll have much to learn from them. This >>> is exactly the kind of stuff I'm currently studying. >>> > > I assume this is for me. Thank you kindly! :-) > >

Re: [Tutor] Sum of Scores

2007-07-26 Thread Terry Carroll
On Thu, 26 Jul 2007, Tiger12506 wrote: > > But you can call the random functions in your code as often as you want > > safely. > >> Perhaps this is a question for the 'language lawyers'? > >> > > Not sure what this means. > > I believe it means 'those who know the language inside and out' like a

Re: [Tutor] Sum of Scores

2007-07-26 Thread Tiger12506
> bhaaluu wrote: >> Greetings, >> >> Beautiful! Thank you SO much for all the variations. >> I'm so sure I'll have much to learn from them. This >> is exactly the kind of stuff I'm currently studying. I assume this is for me. Thank you kindly! :-) >> I have a question for the list. >> After I po

Re: [Tutor] Sum of Scores

2007-07-26 Thread Luke Paireepinart
bhaaluu wrote: > Greetings, > > Beautiful! Thank you SO much for all the variations. > I'm so sure I'll have much to learn from them. This > is exactly the kind of stuff I'm currently studying. > > I have a question for the list. > After I posted my snippet, I added time to import, > and a time.sle

Re: [Tutor] Sum of Scores

2007-07-26 Thread bhaaluu
Greetings, Beautiful! Thank you SO much for all the variations. I'm so sure I'll have much to learn from them. This is exactly the kind of stuff I'm currently studying. I have a question for the list. After I posted my snippet, I added time to import, and a time.sleep(1) line to the code. The rea

Re: [Tutor] Sum of Scores

2007-07-26 Thread R. Alan Monroe
> I want to be able to calculate in the program,.. the total score,.. > either at each successive score,... or when they finally get out. > Not sure how to do that at this point. You're on the right track. You need an additional variable to hold the running total. Alan _

Re: [Tutor] Sum of Scores

2007-07-26 Thread Tiger12506
Note that OP constructed his list so that some values are weighted according to the user's decision (Aggressive or defensive), Just let's not forget that brilliance~ ;-) Suggestions below. > Here is a snippet that might work for one batter: > > #!/usr/bin/env python > # cricket.py > # 2007-07-2

Re: [Tutor] Sum of Scores

2007-07-26 Thread bhaaluu
Greetings, Disclaimer: This source code is written by a Python Newbie. Use at your own risk! =) Here is a snippet that might work for one batter: #!/usr/bin/env python # cricket.py # 2007-07-26 # b h a a l u u at g m a i l dot c o m import random def batterUp(): score=[1,2,

[Tutor] Sum of Scores

2007-07-26 Thread Tony Noyeaux
The projects are moving along. I've created a very simplistic cricket game to learn a few things. The user is asked whether to play Aggressive or Defensively. Once they pick... a random is picked based on their choice,.. and various scores happen until they get out. Ignore the realism at