diff --git a/css/styles.css b/css/styles.css
index e69de29..f32c3f1 100644
--- a/css/styles.css
+++ b/css/styles.css
@@ -0,0 +1,21 @@
+#turnipTable {
+ border: 1px solid #000000;
+ border-spacing: 0;
+ border-collapse: collapse;
+}
+
+#turnipTable th, #turnipTable td {
+ padding: 5px;
+ border: 1px solid #000000;
+ margin: 0;
+ min-width: 50px;
+}
+
+#turnipTable th {
+ text-align: center;
+ vertical-align: top;
+}
+
+#turnipTable td {
+ text-align: right;
+}
\ No newline at end of file
diff --git a/index.html b/index.html
index e9112ff..e61b054 100644
--- a/index.html
+++ b/index.html
@@ -111,22 +111,22 @@
-
+
Your turnip prices will be one of the following patterns. Each cell contains the minimum..maximum price for that half-day. If you don't have a pattern, something's gone wrong, sorry :(. Check back next week!
- Pattern |
- Sunday |
+ Pattern |
+ Sunday |
Monday |
Tuesday |
Wednesday |
Thursday |
Friday |
Saturday |
+ Week Min |
+ Week Max |
- |
- |
AM |
PM |
AM |
@@ -141,9 +141,7 @@
PM |
-
-
-
+
diff --git a/js/scripts.js b/js/scripts.js
index bf32f09..a5ec560 100644
--- a/js/scripts.js
+++ b/js/scripts.js
@@ -563,6 +563,19 @@ function analyze_possibilities(sell_prices) {
prices: global_min_max,
});
+ for (let poss of generated_possibilities) {
+ var weekMins = [];
+ var weekMaxes = [];
+ for (let day of poss.prices.slice(1)) {
+ weekMins.push(day.min);
+ weekMaxes.push(day.max);
+ }
+ poss.weekMin = Math.min(...weekMins);
+ poss.weekMax = Math.max(...weekMaxes);
+ }
+
+ generated_possibilities.sort((a, b) => a.weekMax < b.weekMax);
+
return generated_possibilities;
}
@@ -620,19 +633,19 @@ $(document).on("input", function() {
return;
}
- var output_possibilities = "";
+ let output_possibilities = "";
for (let poss of analyze_possibilities(sell_prices)) {
var out_line = "" + poss.pattern_description + " | "
for (let day of poss.prices.slice(1)) {
- if (day.min != day.max) {
- out_line += "" + day.min + ".." + day.max + " | "
+ if (day.min !== day.max) {
+ out_line += `${day.min}..${day.max} | `;
} else {
- out_line += "" + day.min + " | "
+ out_line += `${day.min} | `;
}
}
- out_line += "
"
+ out_line += `${poss.weekMin} | ${poss.weekMax} | `;
output_possibilities += out_line
}
$("#output").html(output_possibilities)
-})
+});