aboutsummaryrefslogtreecommitdiff
path: root/entries/braxtonhall/hitl2/fib.js
diff options
context:
space:
mode:
Diffstat (limited to 'entries/braxtonhall/hitl2/fib.js')
-rw-r--r--entries/braxtonhall/hitl2/fib.js46
1 files changed, 40 insertions, 6 deletions
diff --git a/entries/braxtonhall/hitl2/fib.js b/entries/braxtonhall/hitl2/fib.js
index e050d96..abefe70 100644
--- a/entries/braxtonhall/hitl2/fib.js
+++ b/entries/braxtonhall/hitl2/fib.js
@@ -29,6 +29,12 @@ const hedges = [
"um. okay.",
"uh okay..",
"so..",
+ "yeah...",
+ "yes. so. um..",
+ "okay. so. um..",
+ "yeah. right. next..",
+ "uh so. right. next..",
+ "next. right. okay..",
];
const confirmations = [
"o right. ofc.",
@@ -37,6 +43,18 @@ const confirmations = [
"thanks.",
"um right. yes.",
"right.",
+ "exactly. thanks.",
+ "yes. thank u.",
+ "right. um thank u.",
+ "right. uh thanks.",
+ "great.",
+ "great. um thanks..",
+ "right right. cool.",
+ "cool. cool thank you.",
+ "cool.",
+ "cool. cool cool. thanks..",
+ "okay yes. cool..",
+ "right thank you. okay..",
];
const innumerables = [
"yeah i don't think we can do that one",
@@ -56,6 +74,9 @@ const dones = [
"oh!",
"wait you did it all.",
"oh that's it?",
+ "ah! yes!",
+ "ah! yes! we're done!",
+ "oh! yes! that's it!",
];
const thinkings = [
"let me just think a second..",
@@ -139,11 +160,24 @@ const number = () =>
: slow(hedge()).then(() => slow(innumerable())).then(number)));
const choose = () =>
- prompt("would you like to use my iteration optimization??? yes????")
- .then((response) => ["y", "yes"].includes(response.trim().toLowerCase()))
- .then((should) => should
- ? fast("yes!").then(() => hitlfibiter)
- : fast("oh.").then(() => slow("okay.")).then(() => slow("we can take it slow.")).then(() => hitlfib));
+ prompt("would you like to use my iteration optimization??? yes???? .. or.. no?")
+ .then((response) => Promise.resolve(["yes", "no", "y", "n"].includes(response.trim().toLowerCase()))
+ .then((formed) => !formed
+ ? slow("um. sorry. one more time..").then(choose)
+ : ["yes", "y"].includes(response.trim().toLowerCase())
+ ? fast("yes!").then(() => hitlfibiter)
+ : fast("oh.").then(() => slow("okay.")).then(() => slow("we can take it slow.")).then(() => hitlfib)));
+
+const optimize = (n) =>
+ n < 4
+ ? hitlfib
+ : n > 25
+ ? slow(hedge())
+ .then(() => fast("acutally.."))
+ .then(() => fast("i need to use my iteration optimization for this."))
+ .then(() => slow("i hope that's okay."))
+ .then(() => hitlfibiter)
+ : choose();
const flow = () =>
slow("\nwhat's the fib you'd like to compute? i can help u out")
@@ -151,7 +185,7 @@ const flow = () =>
.then((n) => slow(confirmation())
.then(() => fast(hedge()))
.then(() => slow(`i will help u compute ${green(`fib ${n}`)}`))
- .then(choose)
+ .then(() => optimize(n))
.then((fib) => fib(n))
.then((fibn) => slow(hedge())
.then(() => fast(done()))