From 54e052d6f29756ba2ee94c31b85fd49e30e335a0 Mon Sep 17 00:00:00 2001 From: Jules Date: Tue, 25 Oct 2016 21:02:46 -0400 Subject: buttons for other courses --- js/course.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) mode change 100644 => 100755 js/course.js (limited to 'js/course.js') diff --git a/js/course.js b/js/course.js old mode 100644 new mode 100755 index 2924eb6..2a35719 --- 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) > 1) { 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) } -- cgit v1.2.3-70-g09d2