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

Newsgroups comp.lang.python
Date 2012-11-20 18:18 -0800
References <SNT139-W8C22F3D436702B17D7803A3560@phx.gbl> <mailman.17.1353367913.29569.python-list@python.org>
Subject Re: Getting a seeded value from a list
From frednotbob@hotmail.ca
Message-ID <mailman.127.1353464302.29569.python-list@python.org> (permalink)

Show all headers | 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