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


Groups > comp.lang.python > #33697

Re: Getting a seeded value from a list

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <frednotbob@hotmail.ca>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.013
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; '(at': 0.03; 'assign': 0.07; 'subject:Getting': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.10; '>the': 0.16; 'level;': 0.16; 'list;': 0.16; 'examples': 0.18; '(or': 0.18; 'assumes': 0.22; 'latter': 0.22; "i'd": 0.22; 'cc:2**0': 0.23; 'player': 0.23; 'this:': 0.23; "i've": 0.23; 'cc:no real name:2**0': 0.24; 'least': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'select': 0.26; 'values': 0.26; 'subject:list': 0.28; 'decide': 0.28; 'floor.': 0.29; 'seed': 0.29; 'starts': 0.29; 'goes': 0.33; "can't": 0.34; 'received:google.com': 0.34; 'list': 0.35; 'whatever': 0.35; 'problem,': 0.35; 'received:209.85': 0.35; 'data.': 0.36; 'level.': 0.36; 'method': 0.36; 'level': 0.37; 'received:209': 0.37; 'far': 0.37; 'subject:: ': 0.38; 'from:no real name:2**0': 0.60; 'first': 0.61; 'back': 0.62; 'different': 0.63; 'levels': 0.66; "'foo'": 0.84; 'game,': 0.84; 'subject:value': 0.84
Newsgroups comp.lang.python
Date Tue, 20 Nov 2012 18:18:17 -0800 (PST)
In-Reply-To <mailman.17.1353367913.29569.python-list@python.org>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=207.6.153.42; posting-account=XDBuBQoAAAA6sjyktzNtjBLLoDr_CyRH
References <SNT139-W8C22F3D436702B17D7803A3560@phx.gbl> <mailman.17.1353367913.29569.python-list@python.org>
User-Agent G2/1.0
X-Google-Web-Client true
X-Google-IP 207.6.153.42
MIME-Version 1.0
Subject Re: Getting a seeded value from a list
From frednotbob@hotmail.ca
To comp.lang.python@googlegroups.com
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
Cc python-list@python.org
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>
Message-ID <mailman.127.1353464302.29569.python-list@python.org> (permalink)
Lines 28
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1353464302 news.xs4all.nl 6934 [2001:888:2000:d::a6]:56661
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:33697

Show key headers only | View raw


>
>The former can be generated from the seed each 
>time you enter the level; the latter must be generated the first time then 
>stored. 
>

Random.random() is already populating the levelSeed list; I've set it as part of new_game() so that any time the player begins a new game, the levelSeed list is replenished with a new set of data.

The problem, in a nutshell, is this:

When the player starts a new game, make_map() randomly generates level 'Foo' as the player's starting floor.  Floor 'Bar' is similarly generated as the player descends from 'Foo' to 'Bar.  

Each time the player goes from 'Foo' to 'Bar' (or vice versa), make_map randomly generates a new layout for either level.

What I'd like to do is select values from 'levelSeed' and assign them to the levels that make_map generates so that the player goes back to the same 'Foo' and 'Bar' each time (at least until the player repopulates levelSeed with new values by whatever method I eventually decide to use).

I simply can't find any relevant examples online; everything I've found so far is either intended for a different purpose or assumes that the reader is already an experienced programmer.

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


Thread

Re: Getting a seeded value from a list Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-11-19 18:31 -0500
  Re: Getting a seeded value from a list frednotbob@hotmail.ca - 2012-11-19 21:45 -0800
  Re: Getting a seeded value from a list frednotbob@hotmail.ca - 2012-11-19 21:45 -0800
    Re: Getting a seeded value from a list Nobody <nobody@nowhere.com> - 2012-11-20 08:26 +0000
  Re: Getting a seeded value from a list frednotbob@hotmail.ca - 2012-11-20 18:18 -0800
    Re: Getting a seeded value from a list Chris Angelico <rosuav@gmail.com> - 2012-11-21 14:41 +1100
      Re: Getting a seeded value from a list Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-21 03:47 +0000
        Re: Getting a seeded value from a list Chris Angelico <rosuav@gmail.com> - 2012-11-21 15:00 +1100
        RE: Getting a seeded value from a list "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-11-23 16:27 +0000
        Re: Getting a seeded value from a list Chris Angelico <rosuav@gmail.com> - 2012-11-24 09:32 +1100
        RE: Getting a seeded value from a list "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-11-26 20:17 +0000
          Re: Getting a seeded value from a list Hans Mulder <hansmu@xs4all.nl> - 2012-11-27 02:01 +0100
        Re: Getting a seeded value from a list Chris Angelico <rosuav@gmail.com> - 2012-11-27 07:24 +1100
  Re: Getting a seeded value from a list frednotbob@hotmail.ca - 2012-11-20 18:18 -0800
    Re: Getting a seeded value from a list Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-21 03:37 +0000

csiph-web