Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #46094

RE: Cutting a deck of cards

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <carlosnepomuceno@outlook.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.036
X-Spam-Evidence '*H*': 0.93; '*S*': 0.00; 'python,': 0.02; 'newbie': 0.05; 'reason,': 0.07; 'suppose': 0.07; 'python': 0.11; 'random': 0.14; 'array.': 0.16; 'cards.': 0.16; 'here).': 0.16; 'thanks,': 0.17; 'import': 0.22; 'to:name:python-list@python.org': 0.22; 'this?': 0.23; 'received:65.55.116': 0.24; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'skip:- 40': 0.29; 'array': 0.29; 'direction': 0.30; 'url:mailman': 0.30; 'anyone': 0.31; 'url:python': 0.33; 'date:': 0.34; "can't": 0.35; 'but': 0.35; 'really': 0.36; 'done': 0.36; 'url:listinfo': 0.36; 'url:org': 0.36; 'half': 0.37; 'two': 0.37; 'email addr:python.org': 0.37; 'to:addr:python-list': 0.38; 'subject:': 0.39; 'moving': 0.39; 'to:addr:python.org': 0.39; 'url:mail': 0.40; 'how': 0.40; 'lower': 0.61; 'simple': 0.61; 'email addr:gmail.com': 0.63; 'cards': 0.65; 'email name:python-list': 0.65; 'cut': 0.74; 'cards,': 0.84; 'subject:Cutting': 0.84; 'cutting': 0.91; '2013': 0.98
X-TMN [f7fbUFwpVAbBb9REF61nIUVoaBgJ9z3D]
X-Originating-Email [carlosnepomuceno@outlook.com]
From Carlos Nepomuceno <carlosnepomuceno@outlook.com>
To "python-list@python.org" <python-list@python.org>
Subject RE: Cutting a deck of cards
Date Sun, 26 May 2013 21:16:22 +0300
Importance Normal
In-Reply-To <4d02f46f-8264-41bf-a254-d1c20469626e@googlegroups.com>
References <4d02f46f-8264-41bf-a254-d1c20469626e@googlegroups.com>
Content-Type text/plain; charset="iso-8859-1"
Content-Transfer-Encoding quoted-printable
MIME-Version 1.0
X-OriginalArrivalTime 26 May 2013 18:16:23.0074 (UTC) FILETIME=[20D64020:01CE5A3D]
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2186.1369592184.3114.python-list@python.org> (permalink)
Lines 30
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1369592184 news.xs4all.nl 15973 [2001:888:2000:d::a6]:41538
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:46094

Show key headers only | View raw


----------------------------------------
> Date: Sun, 26 May 2013 10:52:14 -0700
> Subject: Cutting a deck of cards
> From: rvince99@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 * 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 - 1, moving the lower half of that to the top half of the cards array.
>
> For some reason, I can't see how this can be done (I know that it must be a simple line or two in Python, but I am really stuck here). Anyone have any direction they can give me on this? Thanks, RVic, python newbie
>
> --
> http://mail.python.org/mailman/listinfo/python-list


list(range(13 * 4 * decks)) == range(13 * 4 * decks)

;) 		 	   		  

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Cutting a deck of cards RVic <rvince99@gmail.com> - 2013-05-26 10:52 -0700
  Re: Cutting a deck of cards MRAB <python@mrabarnett.plus.com> - 2013-05-26 19:04 +0100
  Re: Cutting a deck of cards Kamlesh Mutha <mkamlesh@gmail.com> - 2013-05-26 23:35 +0530
  RE: Cutting a deck of cards Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-26 21:16 +0300
    Re: Cutting a deck of cards Marc Christiansen <usenetmail@solar-empire.de> - 2013-05-26 21:36 +0200
      RE: Cutting a deck of cards Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-26 22:54 +0300
        Re: Cutting a deck of cards Marc Christiansen <usenetmail@solar-empire.de> - 2013-05-26 22:13 +0200
      Re: Cutting a deck of cards Terry Jan Reedy <tjreedy@udel.edu> - 2013-05-26 17:03 -0400
  Re: Cutting a deck of cards RVic <rvince99@gmail.com> - 2013-05-26 11:17 -0700
  Re: Cutting a deck of cards Roy Smith <roy@panix.com> - 2013-05-26 14:21 -0400
  Re: Cutting a deck of cards Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-05-26 23:17 +0100
  RE: Cutting a deck of cards Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-27 01:30 +0300
  Re: Cutting a deck of cards Chris Angelico <rosuav@gmail.com> - 2013-05-27 08:42 +1000
  RE: Cutting a deck of cards Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-27 01:51 +0300
  Re: Cutting a deck of cards Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-05-26 23:56 +0100
  Re: Cutting a deck of cards Lee Crocker <leedanielcrocker@gmail.com> - 2013-05-31 04:56 -0700
    Re: Cutting a deck of cards Modulok <modulok@gmail.com> - 2013-05-31 12:54 -0600
    Re: Cutting a deck of cards Joshua Landau <joshua.landau.ws@gmail.com> - 2013-06-01 18:16 +0100
      Re: Cutting a deck of cards Lee Crocker <leedanielcrocker@gmail.com> - 2013-06-01 22:57 -0700
  Re: Cutting a deck of cards Giorgos Tzampanakis <giorgos.tzampanakis@gmail.com> - 2013-06-01 14:58 +0000

csiph-web