> 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
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
>> > 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
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
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
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! :-)
>
>
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
> 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
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
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
> 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
_
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
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,
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
14 matches
Mail list logo