summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2013-08-02 23:09:43 -0400
committerJules Laplace <jules@okfoc.us>2013-08-02 23:09:43 -0400
commita9d7211162bedd318efafbd125bfbb2b712be48d (patch)
tree0d609397f0ba48ca157f6174f0291e4c30664cb8
parent0003c072cb83f48386c5e264d86b0aa3a9eaa20d (diff)
99
-rw-r--r--README2
-rw-r--r--js/app.js2
-rw-r--r--js/course.js10
-rw-r--r--js/flatfile.js2
4 files changed, 9 insertions, 7 deletions
diff --git a/README b/README
index 0faa7dc..044fc69 100644
--- a/README
+++ b/README
@@ -3,7 +3,7 @@ delicious corpse
Exquisite corpse style pairing game.
-http://asdf.us/dc/
+http://asdf.us/corpse/
Original version 2006
Javascript port 2013
diff --git a/js/app.js b/js/app.js
index 847b9a7..6b60d3b 100644
--- a/js/app.js
+++ b/js/app.js
@@ -40,7 +40,7 @@ app.generate = function(){
var courseName = courses[i][0];
var text = "<h2>" + courseName + "</h2>";
for (var j = 1; j < courses[i].length; j++) {
- text += "<p>" + course(courses[i][j]) + "</p>";
+ text += "<p>" + dish(courses[i][j]) + "</p>";
}
texts.push(text);
}
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)
}
diff --git a/js/flatfile.js b/js/flatfile.js
index 1b6b132..89a6b17 100644
--- a/js/flatfile.js
+++ b/js/flatfile.js
@@ -7,7 +7,7 @@ Flatfile.prototype.load = function(){
var _this = this;
app.loader.register(this.key);
$.get("data/" + this.filename, function(data) {
- window[_this.key] = data.split("\n");
+ window[_this.key] = data.split("\n").filter(function(a){ return a && a.length > 0 });
app.loader.ready(_this.key);
})
} \ No newline at end of file