import { answer, Riddle, riddles } from "../../html/find-the-code-together.tsx"; const render_riddle = ({ riddle, id }: { riddle: string; id: number }) => ( `${ id == 0 ? "The answer to this riddle is 10 digits (0-9)." : "All riddles (sans one) 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, truncate: true, }); file.write(encoder.encode(render_riddle({ ...riddle, id }))); file.close(); } riddles.map(write_riddle); const winners: string[] = []; const file = await Deno.open( `/home/mbk/Aims/cohost/static/ftct/${answer}.html`, { write: true, create: true, }, ); file.write(encoder.encode(`
You (plural, I hope) have done well to find this.
I have prepared two rewards for everyone who has found this, alone or working together