Re: card dealer

2013-09-28 Thread Steven D'Aprano
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. Whenever I

Re: card dealer

2013-09-28 Thread Ned Batchelder
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

Re: card dealer

2013-09-28 Thread Dave Angel
On 28/9/2013 06:31, Ned Batchelder wrote: snip 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

Re: card dealer

2013-09-28 Thread Antoon Pardon
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

Re: card dealer

2013-09-28 Thread Tim Roberts
Antoon Pardon antoon.par...@rece.vub.ac.be 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,

card dealer

2013-09-27 Thread markotaht
et väljuda): )) if(n==0): break for i in range(n): tõmba_kaart() HI im trying to make a card dealer, but this code doesent work correctly. It deasl cards, but the cards to repeat. when i type in 52 ten i might get 3 the same cards. This is a translation from my c++ code

Re: card dealer

2013-09-27 Thread Dave Angel
): return randint(0, n) while True: n = int(input(Mitu kaarti tõmmata(0 et väljuda): )) if(n==0): break for i in range(n): tõmba_kaart() HI im trying to make a card dealer, but this code doesent work correctly. It deasl cards, but the cards to repeat

Re: card dealer

2013-09-27 Thread MRAB
): return randint(0, n) while True: n = int(input(Mitu kaarti tõmmata(0 et väljuda): )) if(n==0): break for i in range(n): tõmba_kaart() HI im trying to make a card dealer, but this code doesent work correctly. It deasl cards, but the cards to repeat. when i type

Re: card dealer

2013-09-27 Thread Alister
) while True: n = int(input(Mitu kaarti tõmmata(0 et väljuda): )) if(n==0): break for i in range(n): tõmba_kaart() HI im trying to make a card dealer, but this code doesent work correctly. It deasl cards, but the cards to repeat. when i type in 52 ten i might get

Re: card dealer

2013-09-27 Thread Dave Angel
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.

Re: card dealer

2013-09-27 Thread Denis McMahon
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 prngs

Re: card dealer

2013-09-27 Thread Dave Angel
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

Re: card dealer

2013-09-27 Thread Ned Batchelder
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