On Mon, May 27, 2013 at 4:16 AM, Carlos Nepomuceno
wrote:
> list(range(13 * 4 * decks)) == range(13 * 4 * decks)
>
> ;)
Not in Python 3.
ChrisA
--
http://mail.python.org/mailman/listinfo/python-list
> To: python-list@python.org
> From: breamore...@yahoo.co.uk
[...]
> See this
> http://docs.python.org/3/whatsnew/3.3.html#pep-397-python-launcher-for-windows
>
> --
> If you're using GoogleCrap™ please read this
> http://wiki.python.org/moin/GoogleGroupsPyt
> From: usenetm...@solar-empire.de
> Subject: Re: Cutting a deck of cards
> Date: Sun, 26 May 2013 22:13:55 +0200
> To: python-list@python.org
>
> Carlos Nepomuceno wrote:
>>
>>>
On Sun, May 26, 2013 at 12:17 PM, RVic wrote:
> Ah, brilliant -- yes, this is so much more elegant in Python:
>
> #now cut the cards
> x = random.randrange(2,range(13 * 4 * decks))
> cards = cards[x:]+cards[:x]
Or if for some reason you want to do it in place:
cards[x:], cards[:x] = cards[:x], c
On Sun, May 26, 2013 at 12:16 PM, Carlos Nepomuceno
wrote:
> list(range(13 * 4 * decks)) == range(13 * 4 * decks)
Not in Python 3.
--
http://mail.python.org/mailman/listinfo/python-list
>> and in fact will probably make it worse depending on how you choose
>> the cutpoint.
> I'm pretty sure it won't. Otherwise you'd be lowering entropy by doing
> a random thing to a random thing.
Doing a random thing to a random thing usually *does* lower entropy when
the "random" things are a
On 31 May 2013 12:56, Lee Crocker wrote:
> Why on Earth would you want to? "Cutting" a deck makes no sense in software.
> Randomize the deck properly (Google "Fisher-Yates") and start dealing.
> Cutting the deck will not make it any more random,
True
> and in fact will probably make it worse d
On 2013-05-26, RVic wrote:
> Suppose I have a deck of cards, and I shuffle them
>
> import random
> cards = []
> decks = 6
> cards = list(range(13 * 4 * decks))
> random.shuffle(cards)
>
> So now I have an array of cards. I would like to cut these cards at some
> random point (between 1 and 13 * 4
> Why on Earth would you want to? "Cutting" a deck makes no sense in
> software. Randomize the deck properly (Google "Fisher-Yates") and start
> dealing. Cutting the deck will not make it any more random, and in fact
> will probably make it worse depending on how you choose the cutpoint.
>
> The pu
Why on Earth would you want to? "Cutting" a deck makes no sense in software.
Randomize the deck properly (Google "Fisher-Yates") and start dealing. Cutting
the deck will not make it any more random, and in fact will probably make it
worse depending on how you choose the cutpoint.
The purpose of
On 26/05/2013 23:42, Chris Angelico wrote:
On Mon, May 27, 2013 at 8:30 AM, Carlos Nepomuceno
wrote:
Thanks guys! I've been delaying my dive into Python 3 (because I don't need it
for now) but I'd like to run some code just to learn how different it is from
Python 2 and even other Python flav
> Date: Mon, 27 May 2013 08:42:56 +1000
> Subject: Re: Cutting a deck of cards
> From: ros...@gmail.com
[...]
> Easy. Just grab the standard installer and hit it. You'll get two
> separate directories (or more; I have \Python26,
On Mon, May 27, 2013 at 8:30 AM, Carlos Nepomuceno
wrote:
> Thanks guys! I've been delaying my dive into Python 3 (because I don't need
> it for now) but I'd like to run some code just to learn how different it is
> from Python 2 and even other Python flavors.
>
> So, I'd like to know if it's po
> To: python-list@python.org
> From: breamore...@yahoo.co.uk
[...]
> Wrong if you're using Python 3 :(
>
> --
> If you're using GoogleCrap™ please read this
> http://wiki.python.org/moin/GoogleGroupsPython.
>
> Mark Lawrence
Thanks guys! I've been delaying
On 26/05/2013 19:16, Carlos Nepomuceno wrote:
Date: Sun, 26 May 2013 10:52:14 -0700
Subject: Cutting a deck of cards
From: rvinc...@gmail.com
To: python-list@python.org
Suppose I have a deck of cards, and I shuffle them
import random
cards = []
decks =
On 5/26/2013 3:54 PM, Carlos Nepomuceno wrote:
From: usenetm...@solar-empire.de
[...]
Not in Python3.x
decks = 6
list(range(13 * 4 * decks)) == range(13 * 4 * decks)
False
Adiaŭ
Marc
What does "list(range(13 * 4 * decks))" returns in Python 3?
Carlos Nepomuceno wrote:
>
>> From: usenetm...@solar-empire.de
> [...]
>> Not in Python3.x
> decks = 6
> list(range(13 * 4 * decks)) == range(13 * 4 * decks)
>> False
>
> What does "list(range(13 * 4 * decks))" returns in Python 3?
> From: usenetm...@solar-empire.de
[...]
> Not in Python3.x
decks = 6
list(range(13 * 4 * decks)) == range(13 * 4 * decks)
> False
>
> Adiaŭ
> Marc
What does "list(range(13 * 4 * decks))" returns in Python 3?
Carlos Nepomuceno wrote:
>
>> Date: Sun, 26 May 2013 10:52:14 -0700
>> Subject: Cutting a deck of cards
>> From: rvinc...@gmail.com
>> To: python-list@python.org
>>
>> Suppose I have a deck of cards, and I shuffle them
>>
>> import random
>> cards = []
>> d
In article <4d02f46f-8264-41bf-a254-d1c204696...@googlegroups.com>,
RVic wrote:
> Suppose I have a deck of cards, and I shuffle them
>
> import random
> cards = []
> decks = 6
> cards = list(range(13 * 4 * decks))
> random.shuffle(cards)
>
> So now I have an array of cards. I would like to cut
Ah, brilliant -- yes, this is so much more elegant in Python:
#now cut the cards
x = random.randrange(2,range(13 * 4 * decks))
cards = cards[x:]+cards[:x]
--
http://mail.python.org/mailman/listinfo/python-list
> Date: Sun, 26 May 2013 10:52:14 -0700
> Subject: Cutting a deck of cards
> From: rvinc...@gmail.com
> To: python-list@python.org
>
> Suppose I have a deck of cards, and I shuffle them
>
> import random
> cards = []
> decks = 6
> cards = list(range(13 * 4 *
I guess, you will have to use list slicing mechanism to achieve the desired
result.
Hope this helps,
Cheers,
Kamlesh
On Sun, May 26, 2013 at 11:22 PM, RVic wrote:
> Suppose I have a deck of cards, and I shuffle them
>
> import random
> cards = []
> decks = 6
> cards = list(range(13 * 4 * d
On 26/05/2013 18:52, RVic wrote:
Suppose I have a deck of cards, and I shuffle them
import random
cards = []
decks = 6
cards = list(range(13 * 4 * decks))
random.shuffle(cards)
So now I have an array of cards. I would like to cut these cards at some random
point (between 1 and 13 * 4 * decks -
24 matches
Mail list logo