Help support TMP

"Random List Software?" Topic

12 Posts

All members in good standing are free to post here. Opinions expressed here are solely those of the posters, and have not been cleared with nor are they endorsed by The Miniatures Page.

For more information, see the TMP FAQ.

Back to the Computer Moderated Rules Message Board

1,046 hits since 28 Jul 2010
©1994-2017 Bill Armintrout
Comments or corrections?

bjporter28 Jul 2010 1:19 p.m. PST

Does anyone know of software where you can enter a list of items and have the software select randomly from that list.

Racing Spider Games' Random Force Generator does a lot of what I am looking for, but there is no way to link lists.

For example:

Pick from A, B, or C.

If the selection is A: Pick from 1, 2, 3
If the selection is B: Pick from 4, 5, 6
If the selection is c: Pick from 7, 8, 9

And so forth.

Also the ability to have the system, pick from the same list several times (possibly eliminating options each time- so an item isn't selected multiple times, etc…)

I'm looking for something that will randomly pick from lists of scenario details to give a completely random game scenario.

It would pick from lists of forces available, the game boards to use, how long the game should last, weather, etc…


jfleisher28 Jul 2010 1:34 p.m. PST

I'm pretty sure you could whip something up in Microsoft Excel that would do that.



bjporter28 Jul 2010 9:25 p.m. PST

I was hoping there was some software out there that would make the process a bit more painless!

Thunder28 Jul 2010 10:49 p.m. PST

Sounds very specific even though the concept is generic. It would be an easy task for anyone who is a decent programmer or knows products like Excel or Access. I don't see this as the type of thing that would be both ready to go somewhere an exactly fit the bill of what you need. Programmaticly, its pretty simple. A long, long time ago, I wrote something similar for determining random encounters in D&D and even giving stats, gear, and names of the opponents generated. It also generated treasure. It was written in the ancient basica. If you can do it with that, then you can do it with just about any other PL in existence.

gbowen28 Jul 2010 11:25 p.m. PST

The Excel plan proposed will pick a random number within a range and may pick the same number twice. You need to shuffle a set (array) and pick 1 from the top then work down the set (like drawing from a pack of cards). You can do this in Excel with the array being built on the set of cells or knock it up in your favourite programming language.

John D Salt Inactive Member29 Jul 2010 2:38 p.m. PST

I would recommend using Python for this. OK, I always recommend Python for practically everything, but it is free, and it is good.

The random module (in the standard libraries straight out of the box) gives methods shuffle() and choice() which operate pretty much as you'd expect on a list given as an argument. shuffle(thislist) puts the elements of the list in random order; choice(thislist) picks a random element from the list. If you want to remove an element from the list, thislist.pop() or thislist.remove(element) does it.

The pseudo-random number generator in Python is the Mersenne twister, which is for my money the best you're likely to find, but there is the option of using Wichmann-Hill if for some bizarre reason you prefer to.

All the best,


Personal logo Jeff Ewing Supporting Member of TMP29 Jul 2010 3:53 p.m. PST

I would recommend using Python for this.

ಠ_ರೃ Egad, sir, not only do you give good WWII armor advice, you give good programming advice.

Demosthenes Of Athens30 Jul 2010 2:43 a.m. PST

See Jim Vassilakos's program called RAND.


It is MSDOS but should work under Windows.


John D Salt Inactive Member30 Jul 2010 1:09 p.m. PST

DeLyall wrote:

See Jim Vassilakos's program called RAND.


It is MSDOS but should work under Windows.

Python laughs at Basic's puny linear-congruential PRNG.

All the best,


Chips88 Supporting Member of TMP04 Aug 2010 2:37 p.m. PST

John -

I hate to be dumb but what is Python? How about a link to something we could read and understand it.

pellen Inactive Member11 Sep 2010 3:26 p.m. PST

Python Beginners Guide:

Python tutorials for non-programmers:

To expand on the suggestions by John, this is how you could pick some random units from a list:

>>> import random
>>> a = ['archers 1', 'archers 2', 'cavalry']
>>> random.shuffle(a)
>>> a.pop()
>>> a.pop()
'archers 1'

Just do something like that for several different lists and you have your scenario generator. (You probably want to save it in a script though, not run one line at a time like I did.)

Terrement Supporting Member of TMP25 Oct 2010 10:58 a.m. PST


Sorry - only verified members can post on the forums.