From 5f1876b24585020c9260a6ee18a4f7dff22f0ecb Mon Sep 17 00:00:00 2001 From: mehbark Date: Mon, 21 Aug 2023 22:00:07 -0400 Subject: [PATCH] riddles in place, need to vet though --- html/deno.lock | 17 ---------- html/find-the-code-together.tsx | 59 +++++++++++++++++++++++++++++++++ static/ftct/0.txt | 3 ++ static/ftct/1.txt | 3 ++ static/ftct/10.txt | 3 ++ static/ftct/11.txt | 3 ++ static/ftct/12.txt | 3 ++ static/ftct/13.txt | 3 ++ static/ftct/14.txt | 3 ++ static/ftct/15.txt | 3 ++ static/ftct/16.txt | 3 ++ static/ftct/17.txt | 3 ++ static/ftct/18.txt | 3 ++ static/ftct/19.txt | 3 ++ static/ftct/2.txt | 3 ++ static/ftct/3.txt | 3 ++ static/ftct/4.txt | 3 ++ static/ftct/5.txt | 3 ++ static/ftct/6.txt | 3 ++ static/ftct/7.txt | 3 ++ static/ftct/8.txt | 3 ++ static/ftct/9.txt | 3 ++ static/ftct/gen.ts | 20 +++++++++++ 23 files changed, 139 insertions(+), 17 deletions(-) delete mode 100644 html/deno.lock create mode 100644 html/find-the-code-together.tsx create mode 100644 static/ftct/0.txt create mode 100644 static/ftct/1.txt create mode 100644 static/ftct/10.txt create mode 100644 static/ftct/11.txt create mode 100644 static/ftct/12.txt create mode 100644 static/ftct/13.txt create mode 100644 static/ftct/14.txt create mode 100644 static/ftct/15.txt create mode 100644 static/ftct/16.txt create mode 100644 static/ftct/17.txt create mode 100644 static/ftct/18.txt create mode 100644 static/ftct/19.txt create mode 100644 static/ftct/2.txt create mode 100644 static/ftct/3.txt create mode 100644 static/ftct/4.txt create mode 100644 static/ftct/5.txt create mode 100644 static/ftct/6.txt create mode 100644 static/ftct/7.txt create mode 100644 static/ftct/8.txt create mode 100644 static/ftct/9.txt create mode 100644 static/ftct/gen.ts diff --git a/html/deno.lock b/html/deno.lock deleted file mode 100644 index ad8cece..0000000 --- a/html/deno.lock +++ /dev/null @@ -1,17 +0,0 @@ -{ - "version": "2", - "remote": { - "https://deno.land/std@0.149.0/_util/assert.ts": "e94f2eb37cebd7f199952e242c77654e43333c1ac4c5c700e929ea3aa5489f74", - "https://deno.land/std@0.149.0/bytes/bytes_list.ts": "aba5e2369e77d426b10af1de0dcc4531acecec27f9b9056f4f7bfbf8ac147ab4", - "https://deno.land/std@0.149.0/bytes/equals.ts": "3c3558c3ae85526f84510aa2b48ab2ad7bdd899e2e0f5b7a8ffc85acb3a6043a", - "https://deno.land/std@0.149.0/bytes/mod.ts": "763f97d33051cc3f28af1a688dfe2830841192a9fea0cbaa55f927b49d49d0bf", - "https://deno.land/std@0.149.0/fmt/colors.ts": "6f9340b7fb8cc25a993a99e5efc56fe81bb5af284ff412129dd06df06f53c0b4", - "https://deno.land/std@0.149.0/io/buffer.ts": "bd0c4bf53db4b4be916ca5963e454bddfd3fcd45039041ea161dbf826817822b", - "https://deno.land/std@0.149.0/streams/conversion.ts": "fc3db02026183da795fa32ac7549868e9f19c75ba029d4b4c3739af62b48517a", - "https://deno.land/std@0.149.0/testing/_diff.ts": "029a00560b0d534bc0046f1bce4bd36b3b41ada3f2a3178c85686eb2ff5f1413", - "https://deno.land/std@0.149.0/testing/_format.ts": "0d8dc79eab15b67cdc532826213bbe05bccfd276ca473a50a3fc7bbfb7260642", - "https://deno.land/std@0.149.0/testing/asserts.ts": "0ee58a557ac764e762c62bb21f00e7d897e3919e71be38b2d574fb441d721005", - "https://deno.land/x/copy_paste@v1.1.3/deps.ts": "89bfebe10979530b38b3be2ace3b24a7b83dbecb2a6cca7cd7b05b9a86fb1e61", - "https://deno.land/x/copy_paste@v1.1.3/mod.ts": "3b82d6c620749acb86398bbec1f2c1f472cc39921c22ca7d7a98ab682b170f20" - } -} diff --git a/html/find-the-code-together.tsx b/html/find-the-code-together.tsx new file mode 100644 index 0000000..83c008f --- /dev/null +++ b/html/find-the-code-together.tsx @@ -0,0 +1,59 @@ +import { render_and_copy, randirect } from "./common.tsx"; + +// 0 will be hidden (but it will be obvious that that is a thing, i don't think +// it will be hard to find) +// redirect to what!??!?!?!?!?!??!?! + +export type Riddle = { riddle: string; answer: string }; +// TODO: vet +export const riddles: Riddle[] = [ + { riddle: "I'm the first letter of the alphabet. What am I?", answer: "a" }, + { riddle: "I'm a fruit and also a color. What am I?", answer: "o" }, + { riddle: "I'm a shape with three sides. What am I?", answer: "t" }, + { riddle: "I'm a number that comes after nine. What am I?", answer: "a" }, + { riddle: "I'm a sound a dog makes. What am I?", answer: "b" }, + { + riddle: "I'm a small insect that flies around flowers. What am I?", + answer: "b", + }, + { riddle: "I'm a month with 30 days. What am I?", answer: "a" }, + { + riddle: "I'm a punctuation mark used to end sentences. What am I?", + answer: "p", + }, + { riddle: "I'm a planet closest to the sun. What am I?", answer: "m" }, + { + riddle: "I'm a body part that you use to smell. What am I?", + answer: "n", + }, + { riddle: "I'm a type of nut often used in pies. What am I?", answer: "p" }, + { + riddle: "I'm a metal that's attracted to magnets. What am I?", + answer: "i", + }, + { + riddle: "I'm a type of bird associated with wisdom. What am I?", + answer: "o", + }, + { riddle: "I'm a reptile that can change color. What am I?", answer: "c" }, + { riddle: "I'm a letter that sounds like 'you.' What am I?", answer: "u" }, + { + riddle: "I'm a game where you try to sink your opponent's ships. What am I?", + answer: "b", + }, + { + riddle: "I'm a type of flower often given on Valentine's Day. What am I?", + answer: "r", + }, + { + riddle: "I'm a beverage made from beans and enjoyed hot. What am I?", + answer: "c", + }, + { + riddle: "I'm a country known for kangaroos and the Outback. What am I?", + answer: "a", + }, + { riddle: "I'm a shape with four equal sides. What am I?", answer: "s" }, +]; + +const answer = riddles.map(r => r.answer).join(); diff --git a/static/ftct/0.txt b/static/ftct/0.txt new file mode 100644 index 0000000..5fea63f --- /dev/null +++ b/static/ftct/0.txt @@ -0,0 +1,3 @@ +All riddles have a one letter answer (a-z). +This is riddle #0 (nice job finding this one!) +I'm the first letter of the alphabet. What am I? \ No newline at end of file diff --git a/static/ftct/1.txt b/static/ftct/1.txt new file mode 100644 index 0000000..85e62f3 --- /dev/null +++ b/static/ftct/1.txt @@ -0,0 +1,3 @@ +All riddles have a one letter answer (a-z). +This is riddle #1 +I'm a fruit and also a color. What am I? \ No newline at end of file diff --git a/static/ftct/10.txt b/static/ftct/10.txt new file mode 100644 index 0000000..94e8583 --- /dev/null +++ b/static/ftct/10.txt @@ -0,0 +1,3 @@ +All riddles have a one letter answer (a-z). +This is riddle #10 +I'm a type of nut often used in pies. What am I? \ No newline at end of file diff --git a/static/ftct/11.txt b/static/ftct/11.txt new file mode 100644 index 0000000..e4ea3cd --- /dev/null +++ b/static/ftct/11.txt @@ -0,0 +1,3 @@ +All riddles have a one letter answer (a-z). +This is riddle #11 +I'm a metal that's attracted to magnets. What am I? \ No newline at end of file diff --git a/static/ftct/12.txt b/static/ftct/12.txt new file mode 100644 index 0000000..f67e7b1 --- /dev/null +++ b/static/ftct/12.txt @@ -0,0 +1,3 @@ +All riddles have a one letter answer (a-z). +This is riddle #12 +I'm a type of bird associated with wisdom. What am I? \ No newline at end of file diff --git a/static/ftct/13.txt b/static/ftct/13.txt new file mode 100644 index 0000000..844570a --- /dev/null +++ b/static/ftct/13.txt @@ -0,0 +1,3 @@ +All riddles have a one letter answer (a-z). +This is riddle #13 +I'm a reptile that can change color. What am I? \ No newline at end of file diff --git a/static/ftct/14.txt b/static/ftct/14.txt new file mode 100644 index 0000000..ae34259 --- /dev/null +++ b/static/ftct/14.txt @@ -0,0 +1,3 @@ +All riddles have a one letter answer (a-z). +This is riddle #14 +I'm a letter that sounds like 'you.' What am I? \ No newline at end of file diff --git a/static/ftct/15.txt b/static/ftct/15.txt new file mode 100644 index 0000000..8553d6f --- /dev/null +++ b/static/ftct/15.txt @@ -0,0 +1,3 @@ +All riddles have a one letter answer (a-z). +This is riddle #15 +I'm a game where you try to sink your opponent's ships. What am I? \ No newline at end of file diff --git a/static/ftct/16.txt b/static/ftct/16.txt new file mode 100644 index 0000000..3c67911 --- /dev/null +++ b/static/ftct/16.txt @@ -0,0 +1,3 @@ +All riddles have a one letter answer (a-z). +This is riddle #16 +I'm a type of flower often given on Valentine's Day. What am I? \ No newline at end of file diff --git a/static/ftct/17.txt b/static/ftct/17.txt new file mode 100644 index 0000000..4bb6681 --- /dev/null +++ b/static/ftct/17.txt @@ -0,0 +1,3 @@ +All riddles have a one letter answer (a-z). +This is riddle #17 +I'm a beverage made from beans and enjoyed hot. What am I? \ No newline at end of file diff --git a/static/ftct/18.txt b/static/ftct/18.txt new file mode 100644 index 0000000..9cd77b0 --- /dev/null +++ b/static/ftct/18.txt @@ -0,0 +1,3 @@ +All riddles have a one letter answer (a-z). +This is riddle #18 +I'm a country known for kangaroos and the Outback. What am I? \ No newline at end of file diff --git a/static/ftct/19.txt b/static/ftct/19.txt new file mode 100644 index 0000000..284ad2e --- /dev/null +++ b/static/ftct/19.txt @@ -0,0 +1,3 @@ +All riddles have a one letter answer (a-z). +This is riddle #19 +I'm a shape with four equal sides. What am I? \ No newline at end of file diff --git a/static/ftct/2.txt b/static/ftct/2.txt new file mode 100644 index 0000000..30ed053 --- /dev/null +++ b/static/ftct/2.txt @@ -0,0 +1,3 @@ +All riddles have a one letter answer (a-z). +This is riddle #2 +I'm a shape with three sides. What am I? \ No newline at end of file diff --git a/static/ftct/3.txt b/static/ftct/3.txt new file mode 100644 index 0000000..6bffedb --- /dev/null +++ b/static/ftct/3.txt @@ -0,0 +1,3 @@ +All riddles have a one letter answer (a-z). +This is riddle #3 +I'm a number that comes after nine. What am I? \ No newline at end of file diff --git a/static/ftct/4.txt b/static/ftct/4.txt new file mode 100644 index 0000000..d88c8c9 --- /dev/null +++ b/static/ftct/4.txt @@ -0,0 +1,3 @@ +All riddles have a one letter answer (a-z). +This is riddle #4 +I'm a sound a dog makes. What am I? \ No newline at end of file diff --git a/static/ftct/5.txt b/static/ftct/5.txt new file mode 100644 index 0000000..45b70f1 --- /dev/null +++ b/static/ftct/5.txt @@ -0,0 +1,3 @@ +All riddles have a one letter answer (a-z). +This is riddle #5 +I'm a small insect that flies around flowers. What am I? \ No newline at end of file diff --git a/static/ftct/6.txt b/static/ftct/6.txt new file mode 100644 index 0000000..72566b9 --- /dev/null +++ b/static/ftct/6.txt @@ -0,0 +1,3 @@ +All riddles have a one letter answer (a-z). +This is riddle #6 +I'm a month with 30 days. What am I? \ No newline at end of file diff --git a/static/ftct/7.txt b/static/ftct/7.txt new file mode 100644 index 0000000..7ab1f3f --- /dev/null +++ b/static/ftct/7.txt @@ -0,0 +1,3 @@ +All riddles have a one letter answer (a-z). +This is riddle #7 +I'm a punctuation mark used to end sentences. What am I? \ No newline at end of file diff --git a/static/ftct/8.txt b/static/ftct/8.txt new file mode 100644 index 0000000..633534d --- /dev/null +++ b/static/ftct/8.txt @@ -0,0 +1,3 @@ +All riddles have a one letter answer (a-z). +This is riddle #8 +I'm a planet closest to the sun. What am I? \ No newline at end of file diff --git a/static/ftct/9.txt b/static/ftct/9.txt new file mode 100644 index 0000000..0539855 --- /dev/null +++ b/static/ftct/9.txt @@ -0,0 +1,3 @@ +All riddles have a one letter answer (a-z). +This is riddle #9 +I'm a body part that you use to smell. What am I? \ No newline at end of file diff --git a/static/ftct/gen.ts b/static/ftct/gen.ts new file mode 100644 index 0000000..0dd5764 --- /dev/null +++ b/static/ftct/gen.ts @@ -0,0 +1,20 @@ +import { Riddle, riddles } from "../../html/find-the-code-together.tsx"; + +const render_riddle = ({ riddle, id }: { riddle: string; id: number }) => ( + `All riddles have a one letter answer (a-z). +This is riddle #${id} ${id == 0 ? "(nice job finding this one!)" : ""} +${riddle}` +); + +const encoder = new TextEncoder(); + +async function write_riddle(riddle: Riddle, id: number) { + const file = await Deno.open(`/home/mbk/Aims/cohost/static/ftct/${id}.txt`, { + write: true, + create: true, + }); + file.write(encoder.encode(render_riddle({ ...riddle, id }))); + file.close(); +} + +riddles.map(write_riddle);