From fcb1fa90d4cdcb411baa7f18355470315d3c7507 Mon Sep 17 00:00:00 2001 From: rxi Date: Wed, 12 Mar 2014 13:16:14 +0000 Subject: [PATCH] Reworded description of lume.weightedchoice() in README --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c457cc1..8f5a4bb 100644 --- a/README.md +++ b/README.md @@ -66,10 +66,9 @@ lume.randomchoice({true, false}) -- Returns either true or false ### lume.weightedchoice(t) Takes the argument table `t` where the keys are the possible choices and the -values are the choice's weight. A weight should be 0 or above, the larger the -weight value the higher the probability of that choice being picked. If the -table is empty or all the weights are 0 or a weight is below zero an error is -raised. +value is the choice's weight. A weight should be 0 or above, the larger the +number the higher the probability of that choice being picked. If the table is +empty, a weight is below zero or all the weights are 0 then an error is raised. ```lua lume.weightedchoice({ ["cat"] = 10, ["dog"] = 5, ["frog"] = 0 }) -- Returns either "cat" or "dog" with "cat" being twice as likely to be chosen.