diff options
| author | Jules Laplace <jules@okfoc.us> | 2013-08-02 23:09:43 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2013-08-02 23:09:43 -0400 |
| commit | a9d7211162bedd318efafbd125bfbb2b712be48d (patch) | |
| tree | 0d609397f0ba48ca157f6174f0291e4c30664cb8 /js/course.js | |
| parent | 0003c072cb83f48386c5e264d86b0aa3a9eaa20d (diff) | |
99
Diffstat (limited to 'js/course.js')
| -rw-r--r-- | js/course.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/js/course.js b/js/course.js index 2924eb6..f422e6d 100644 --- a/js/course.js +++ b/js/course.js @@ -14,11 +14,11 @@ function course(n) { var ds = [ dish() ]; return ds.join(", "); } -function dish(){ - var pcount = rand(3) + 1; +function dish(n){ + var pcount = n || rand(2) + 1; var ps = []; while (pcount-- > 0) ps.push(product()); - if (rand(100) > 60) { + if (rand(100) < 90) { var d = ps.join(" and ") + " " + choice(preparations); } else { @@ -28,7 +28,7 @@ function dish(){ } function product(){ var result; - if (rand(100) > 90) { + if (rand(100) > 99) { var technique = choice(techniques); if (technique[0] == '-') { result = choice(products) + technique + " " + choice(products); @@ -36,9 +36,11 @@ function product(){ result = technique + " " + choice(products) } } +/* else if (rand(100) > 0) { result = choice(products) + " " + choice(products) } +*/ else { result = choice(products) } |
