Antoon Pardon wrote:
>
>Op 28-09-13 12:31, Ned Batchelder schreef:
>>
>> I've thought that way about it too: there are so many shuffles any way,
>> it won't be a problem. But think about it like this: if you shuffle a
>> deck of 52 cards with a default Python random object, then once you have
>>
Op 28-09-13 12:31, Ned Batchelder schreef:
On 9/28/13 2:01 AM, Steven D'Aprano wrote:
On Fri, 27 Sep 2013 17:40:46 -0400, Ned Batchelder wrote:
On 9/27/13 12:10 PM, Denis McMahon wrote:
On Fri, 27 Sep 2013 12:08:33 +, Dave Angel wrote:
i recall
writing a shuffle function in C decades ag
On 28/9/2013 06:31, Ned Batchelder wrote:
>
> I've thought that way about it too: there are so many shuffles any way,
> it won't be a problem. But think about it like this: if you shuffle a
> deck of 52 cards with a default Python random object, then once you have
> dealt out only 28 car
On 9/28/13 2:01 AM, Steven D'Aprano wrote:
On Fri, 27 Sep 2013 17:40:46 -0400, Ned Batchelder wrote:
On 9/27/13 12:10 PM, Denis McMahon wrote:
On Fri, 27 Sep 2013 12:08:33 +, Dave Angel wrote:
i recall
writing a shuffle function in C decades ago, which took an array of
(52) unique items
On Fri, 27 Sep 2013 17:40:46 -0400, Ned Batchelder wrote:
> On 9/27/13 12:10 PM, Denis McMahon wrote:
>> On Fri, 27 Sep 2013 12:08:33 +, Dave Angel wrote:
>>
>>> i recall
>>> writing a shuffle function in C decades ago, which took an array of
>>> (52) unique items and put them in random order.
On 9/27/13 12:10 PM, Denis McMahon wrote:
On Fri, 27 Sep 2013 12:08:33 +, Dave Angel wrote:
i recall
writing a shuffle function in C decades ago, which took an array of (52)
unique items and put them in random order.
Whenever I tried to write shuffles I came up against a fairly fundamental
On 27/9/2013 12:10, Denis McMahon wrote:
> On Fri, 27 Sep 2013 12:08:33 +, Dave Angel wrote:
>
>> i recall
>> writing a shuffle function in C decades ago, which took an array of (52)
>> unique items and put them in random order.
>
> Whenever I tried to write shuffles I came up against a fairly
On Fri, 27 Sep 2013 12:08:33 +, Dave Angel wrote:
> i recall
> writing a shuffle function in C decades ago, which took an array of (52)
> unique items and put them in random order.
Whenever I tried to write shuffles I came up against a fairly fundamental
limit:
52! > prng states
Granted pr
On 27/9/2013 07:26, Dave Angel wrote:
> On 27/9/2013 06:24, markot...@gmail.com wrote:
>
I sent the previous message long before I had finished.
>
> If you had created your global list containing list(range(52)), then you
> could do nearly your entire program with one call to random.sample.
>
> ht
kaart % 13 a = kaart / 13 print(mast[int(a)] + " " +
> aste[int(m)])
>
> def vali_järgmine_vaba(n):
> i = -1
>
> while(n > 0):
> n -= 1 i = i + 1 while kaart_tõmmatud[i]:
> i = i + 1
> kaart_tõmmatud[i] = True return
+ aste[int(m)])
def vali_järgmine_vaba(n):
i = -1
while(n > 0):
n -= 1
i = i + 1
while kaart_tõmmatud[i]:
i = i + 1
kaart_tõmmatud[i] = True
return i
def random(n):
return randint(0, n)
while True:
n = int(input("Mitu
= vali_järgmine_vaba(n)
> m = kaart % 13
> a = kaart / 13
> print(mast[int(a)] + " " + aste[int(m)])
>
> def vali_järgmine_vaba(n):
> i = -1
>
> while(n > 0):
> n -= 1
> i = i + 1
> while kaart_tõmmatud[i]:
>
> 0):
n -= 1
i = i + 1
while kaart_tõmmatud[i]:
i = i + 1
kaart_tõmmatud[i] = True
return i
def random(n):
return randint(0, n)
while True:
n = int(input("Mitu kaarti tõmmata(0 et väljuda): "))
if(n==0):
break
f
13 matches
Mail list logo