Latest Lists

Making a game and need a simple program to generate random shop lists of items in stock?

Simple as that. I have a list of items for my in game shops and I want a program that will randomly generate lists of items based on rarity and availability. It would also be nice if I could print off the lists. Is there a program that's already out there?

Public Comments

  1. Not sure of any existing stock applications that would do this but my approach would be something like this. You'll need to provide a list/table of the items and their availability (something like this): AvailibilityRate, ItemName, etc... 0.001, Ultra Rare Foo 0.1, Semi-rare Foo 0.8, Common Foo 0.99, Junk Foo Next you would use some availability generator class that would read the AvailabilityRate and come up with a way to randomly decide what is available. If you think of it as a percentage, your generator class could use a suitable range (say 1-999) and divide by 100 (giving you 0.001 - .999). Take the result of the random number and assign a range to select an item from. Example: If the random value is .558, use the Common Foo item (which is 0.8). If the item is 0.04, go with Semi-rare Foo. The chance of getting the Ultra-rare Foo would be fairly small and would represent it being rare.
Powered by Yahoo! Answers