Rosetta Code:Village Pump/Suggest a programming task: Difference between revisions

m
mNo edit summary
Line 740:
 
=== Weighted Random ===
Pick a random item from a list of dozen items, where each item has different weight (rarity). If the language permits, the list should be made in a way that makes it easy to add new items to it without having to adjust the weights of the existing items.
 
Gaming example: random treasure generation in roguelikes. I've found that this is extremely awkward to do in some languages, and simple in others.
 
== Partitioning ==
5

edits