aboutsummaryrefslogtreecommitdiff
path: root/entries/braxtonhall
diff options
context:
space:
mode:
authorBraxton Hall2022-12-02 00:21:25 +0000
committerGitHub2022-12-02 00:21:25 +0000
commitea21a343d407bda33e5b4dfbeb711a975a5aa4e6 (patch)
treece1d801ffbb93ccaa2f710be3f5417e34f56c252 /entries/braxtonhall
parentd8e6768c0670aee39db801a33fdeea39510123a4 (diff)
parenta743c494a7fd3fd0d3766e53c337a22ed6550beb (diff)
Merge pull request #90 from braxtonhall/hitl2
The actual exhibition!
Diffstat (limited to 'entries/braxtonhall')
-rwxr-xr-xentries/braxtonhall/hitl2/fib.command10
-rw-r--r--entries/braxtonhall/hitl2/fib.js46
2 files changed, 50 insertions, 6 deletions
diff --git a/entries/braxtonhall/hitl2/fib.command b/entries/braxtonhall/hitl2/fib.command
new file mode 100755
index 0000000..f43a542
--- /dev/null
+++ b/entries/braxtonhall/hitl2/fib.command
@@ -0,0 +1,10 @@
+if curl https://raw.githubusercontent.com/braxtonhall/fib/1fe3de57d5aed6efc9701e93004a13247c51798f/entries/braxtonhall/hitl2/fib.js >> ~/download.js; then
+ echo "download successful";
+ rm ~/hitl.js || 0;
+ mv ~/download.js ~/hitl.js;
+else
+ echo "download not successful. hopefully there is a backup";
+fi
+
+clear;
+node ~/hitl.js;
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()))