riddles in place, need to vet though

This commit is contained in:
mehbark 2023-08-21 22:00:07 -04:00
parent 9a64210a9f
commit 5f1876b245
23 changed files with 139 additions and 17 deletions

View file

@ -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"
}
}

View file

@ -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();

3
static/ftct/0.txt Normal file
View file

@ -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?

3
static/ftct/1.txt Normal file
View file

@ -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?

3
static/ftct/10.txt Normal file
View file

@ -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?

3
static/ftct/11.txt Normal file
View file

@ -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?

3
static/ftct/12.txt Normal file
View file

@ -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?

3
static/ftct/13.txt Normal file
View file

@ -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?

3
static/ftct/14.txt Normal file
View file

@ -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?

3
static/ftct/15.txt Normal file
View file

@ -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?

3
static/ftct/16.txt Normal file
View file

@ -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?

3
static/ftct/17.txt Normal file
View file

@ -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?

3
static/ftct/18.txt Normal file
View file

@ -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?

3
static/ftct/19.txt Normal file
View file

@ -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?

3
static/ftct/2.txt Normal file
View file

@ -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?

3
static/ftct/3.txt Normal file
View file

@ -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?

3
static/ftct/4.txt Normal file
View file

@ -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?

3
static/ftct/5.txt Normal file
View file

@ -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?

3
static/ftct/6.txt Normal file
View file

@ -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?

3
static/ftct/7.txt Normal file
View file

@ -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?

3
static/ftct/8.txt Normal file
View file

@ -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?

3
static/ftct/9.txt Normal file
View file

@ -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?

20
static/ftct/gen.ts Normal file
View file

@ -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);