diff --git a/public/day/2/large_message_encoded.txt b/public/day/2/large_message_encoded.txt new file mode 100644 index 0000000..6f567e8 --- /dev/null +++ b/public/day/2/large_message_encoded.txt @@ -0,0 +1,63 @@ +\45\07\04 \41\14\11\00\17 \30\23\15\17\04\18\18 \01\24 \28\07\17\08\18 \47\00\13 \26\11\11\18\01\20\17\06 + + + + \40\13 \28\07\17\08\18\19\12\00\18 \30\21\04, \12\00\13\24 \24\04\00\17\18 \00\06\14, \34 \11\00\24 \16\20\08\04\19\11\24 \08\13 \12\24 \01\04\03. \34 \03\08\03 \13\14\19 \17\20\18\19\11\04 \19\07\04 \18\07\04\04\19\18. \34 \01\17\04\00\19\07\04\03 \18\11\14\22\11\24 \00\13\03 \18\08\11\04\13\19\11\24. \34 \22\00\18 \11\08\18\19\04\13\08\13\06 \05\14\17 \00 \18\14\20\13\03 – \00 \18\14\20\13\03 \00 \05\17\08\04\13\03 \07\00\03 \19\14\11\03 \12\04 \34’\03 \13\04\21\04\17 \07\04\00\17- \19\07\04 \17\08\13\06\08\13\06 \01\04\11\11\18 \14\05 \44\00\13\19\00’\18 \18\11\04\08\06\07. + + “\45\07\04\17\04 \08\18 \13\14 \44\00\13\19\00,” \12\24 \05\17\08\04\13\03 \07\00\03 \08\13\18\08\18\19\04\03, \01\20\19 \34 \10\13\04\22 \07\04 \22\00\18 \22\17\14\13\06. + + \37\00\19\04 \19\07\00\19 \13\08\06\07\19 \34 \03\08\03 \07\04\00\17 \18\14\20\13\03\18, \19\07\14\20\06\07 \13\14\19 \14\05 \17\08\13\06\08\13\06 \01\04\11\11\18. \31\17\14\12 \14\20\19\18\08\03\04 \02\00\12\04 \19\07\04 \18\14\20\13\03\18 \14\05 \07\08\18\18\08\13\06 \18\19\04\00\12 \00\13\03 \18\16\20\04\00\10\08\13\06 \12\04\19\00\11. \34 \11\14\14\10\04\03 \19\07\17\14\20\06\07 \12\24 \22\08\13\03\14\22 \00\13\03 \18\00\22 \00 \19\17\00\08\13 \18\19\00\13\03\08\13\06 \15\04\17\05\04\02\19\11\24 \18\19\08\11\11 \08\13 \05\17\14\13\19 \14\05 \12\24 \07\14\20\18\04. + + \34\19 \22\00\18 \22\17\00\15\15\04\03 \08\13 \00\13 \00\15\17\14\13 \14\05 \18\19\04\00\12. \44\13\14\22\05\11\00\10\04\18 \05\04\11\11 \11\08\06\07\19\11\24 \00\17\14\20\13\03 \08\19. \26 \02\14\13\03\20\02\19\14\17 \18\19\14\14\03 \00\19 \19\07\04 \14\15\04\13 \03\14\14\17 \14\05 \14\13\04 \14\05 \19\07\04 \02\00\17\18. \33\04 \19\14\14\10 \00 \11\00\17\06\04 \15\14\02\10\04\19 \22\00\19\02\07 \05\17\14\12 \07\08\18 \21\04\18\19, \19\07\04\13 \11\14\14\10\04\03 \20\15 \00\19 \12\24 \22\08\13\03\14\22. \34 \15\20\19 \14\13 \12\24 \18\11\08\15\15\04\17\18 \00\13\03 \17\14\01\04. \34 \19\08\15\19\14\04\03 \03\14\22\13\18\19\00\08\17\18 \00\13\03 \14\20\19 \19\07\04 \03\14\14\17. + + “\26\11\11 \00\01\14\00\17\03,” \19\07\04 \02\14\13\03\20\02\19\14\17 \02\17\08\04\03 \14\20\19. \34 \17\00\13 \20\15 \19\14 \07\08\12. + + “\48\04\11\11, \07\04 \18\00\08\03, “\00\17\04 \24\14\20 \02\14\12\08\13\06?” + + “\48\07\04\17\04?” \34 \00\18\10\04\03. + + “\48\07\24 \19\14 \19\07\04 \39\14\17\19\07 \41\14\11\04 \14\05 \02\14\20\17\18\04,” \22\00\18 \07\08\18 \00\13\18\22\04\17. “\45\07\08\18 \08\18 \19\07\04 \41\14\11\00\17 \30\23\15\17\04\18\18.” \34 \19\14\14\10 \07\08\18 \14\20\19\18\19\17\04\19\02\07\04\03 \07\00\13\03 \00\13\03 \07\04 \15\20\11\11\04\03 \12\04 \00\01\14\00\17\03. + + \45\07\04 \19\17\00\08\13 \22\00\18 \05\08\11\11\04\03 \22\08\19\07 \14\19\07\04\17 \02\07\08\11\03\17\04\13, \00\11\11 \08\13 \19\07\04\08\17 \15\00\09\00\12\00\18 \00\13\03 \13\08\06\07\19\06\14\22\13\18. \48\04 \18\00\13\06 \28\07\17\08\18\19\12\00\18 \02\00\17\14\11\18 \00\13\03 \00\19\04 \02\00\13\03\08\04\18 \22\08\19\07 \13\14\20\06\00\19 \02\04\13\19\04\17\18 \00\18 \22\07\08\19\04 \00\18 \18\13\14\22. \48\04 \03\17\00\13\10 \07\14\19 \02\14\02\14\00 \00\18 \19\07\08\02\10 \00\13\03 \17\08\02\07 \00\18 \12\04\11\19\04\03 \02\07\14\02\14\11\00\19\04 \01\00\17\18. \40\20\19\18\08\03\04, \19\07\04 \11\08\06\07\19\18 \14\05 \19\14\22\13\18 \00\13\03 \21\08\11\11\00\06\04\18 \05\11\08\02\10\04\17\04\03 \08\13 \19\07\04 \03\08\18\19\00\13\02\04 \00\18 \19\07\04 \41\14\11\00\17 \30\23\15\17\04\18\18 \17\00\02\04\03 \13\14\17\19\07\22\00\17\03. + + \44\14\14\13 \19\07\04\17\04 \22\04\17\04 \13\14 \12\14\17\04 \11\08\06\07\19\18 \19\14 \01\04 \18\04\04\13. \48\04 \19\17\00\21\04\11\04\03 \19\07\17\14\20\06\07 \02\14\11\03, \03\00\17\10 \05\14\17\04\18\19\18, \22\07\04\17\04 \11\04\00\13 \22\14\11\21\04\18 \17\14\00\12\04\03 \00\13\03 \22\07\08\19\04-\19\00\08\11\04\03 \17\00\01\01\08\19\18 \07\08\03 \05\17\14\12 \14\20\17 \19\17\00\08\13 \00\18 \08\19 \19\07\20\13\03\04\17\04\03 \19\07\17\14\20\06\07 \19\07\04 \16\20\08\04\19 \22\08\11\03\04\17\13\04\18\18. + + \48\04 \02\11\08\12\01\04\03 \12\14\20\13\19\00\08\13\18 \18\14 \07\08\06\07 \08\19 \18\04\04\12\04\03 \00\18 \08\05 \22\04 \22\14\20\11\03 \18\02\17\00\15\04 \19\07\04 \12\14\14\13. \27\20\19 \19\07\04 \41\14\11\00\17 \30\23\15\17\04\18\18 \13\04\21\04\17 \18\11\14\22\04\03 \03\14\22\13. \31\00\18\19\04\17 \00\13\03 \05\00\18\19\04\17 \22\04 \17\00\13 \00\11\14\13\06, \17\14\11\11\08\13\06 \14\21\04\17 \15\04\00\10\18 \00\13\03 \19\07\17\14\20\06\07 \21\00\11\11\04\24\18 \11\08\10\04 \00 \02\00\17 \14\13 \00 \17\14\11\11\04\17 \02\14\00\18\19\04\17. + + \45\07\04 \12\14\20\13\19\00\08\13\18 \19\20\17\13\04\03 \08\13\19\14 \07\08\11\11\18, \19\07\04 \07\08\11\11\18 \19\14 \18\13\14\22-\02\14\21\04\17\04\03 \15\11\00\08\13\18. \48\04 \02\17\14\18\18\04\03 \00 \01\00\17\17\04\13 \03\04\18\04\17\19 \14\05 \08\02\04—\19\07\04 \32\17\04\00\19 \41\14\11\00\17 \34\02\04 \28\00\15. \37\08\06\07\19\18 \00\15\15\04\00\17\04\03 \08\13 \19\07\04 \03\08\18\19\00\13\02\04. \45\07\04\24 \11\14\14\10\04\03 \11\08\10\04 \19\07\04 \11\08\06\07\19\18 \14\05 \00 \18\19\17\00\13\06\04 \14\02\04\00\13 \11\08\13\04\17 \18\00\08\11\08\13\06 \14\13 \00 \05\17\14\25\04\13 \18\04\00. “\45\07\04\17\04,” \18\00\08\03 \19\07\04 \02\14\13\03\20\02\19\14\17, “\08\18 \19\07\04 \39\14\17\19\07 \41\14\11\04.” + + \45\07\04 \39\14\17\19\07 \41\14\11\04. \34\19 \22\00\18 \00 \07\20\06\04 \02\08\19\24 \18\19\00\13\03\08\13\06 \00\11\14\13\04 \00\19 \19\07\04 \19\14\15 \14\05 \19\07\04 \22\14\17\11\03, \05\08\11\11\04\03 \22\08\19\07 \05\00\02\19\14\17\08\04\18 \22\07\04\17\04 \04\21\04\17\24 \28\07\17\08\18\19\12\00\18 \19\14\24 \22\00\18 \12\00\03\04. + + \26\19 \05\08\17\18\19 \22\04 \18\00\22 \13\14 \04\11\21\04\18. + + “\45\07\04\24 \00\17\04 \06\00\19\07\04\17\08\13\06 \00\19 \19\07\04 \02\04\13\19\04\17 \14\05 \19\07\04 \02\08\19\24,” \19\07\04 \02\14\13\03\20\02\19\14\17 \19\14\11\03 \20\18. “\45\07\00\19 \08\18 \22\07\04\17\04 \44\00\13\19\00 \22\08\11\11 \06\08\21\04 \19\07\04 \05\08\17\18\19 \06\08\05\19 \14\05 \28\07\17\08\18\19\12\00\18.” + + “\48\07\14 \17\04\02\04\08\21\04\18 \19\07\04 \05\08\17\18\19 \06\08\05\19?” \22\04 \00\11\11 \00\18\10\04\03. + + “\33\04 \22\08\11\11 \02\07\14\14\18\04 \14\13\04 \14\05 \24\14\20.” + + “\37\14\14\10,” \18\07\14\20\19\04\03 \14\13\04 \14\05 \19\07\04 \02\07\08\11\03\17\04\13,“\19\07\04 \04\11\21\04\18.” \40\20\19\18\08\03\04 \22\04 \18\00\22 \07\20\13\03\17\04\03\18 \14\05 \04\11\21\04\18. \26\18 \14\20\17 \19\17\00\08\13 \03\17\04\22 \02\11\14\18\04\17 \19\14 \19\07\04 \02\04\13\19\04\17 \14\05 \19\07\04 \39\14\17\19\07 \41\14\11\04, \22\04 \18\11\14\22\04\03 \19\14 \00 \02\17\00\22\11, \18\14 \02\17\14\22\03\04\03 \22\04\17\04 \19\07\04 \18\19\17\04\04\19\18 \22\08\19\07 \44\00\13\19\00’\18 \07\04\11\15\04\17\18. \48\07\04\13 \19\07\04 \41\14\11\00\17 \30\23\15\17\04\18\18 \02\14\20\11\03 \06\14 \13\14 \05\00\17\19\07\04\17, \22\04 \18\19\14\15\15\04\03 \00\13\03 \19\07\04 \02\14\13\03\20\02\19\14\17 \11\04\03 \20\18 \14\20\19\18\08\03\04. + + \48\04 \15\17\04\18\18\04\03 \19\07\17\14\20\06\07 \19\07\04 \02\17\14\22\03 \19\14 \19\07\04 \04\03\06\04 \14\05 \00 \11\00\17\06\04, \14\15\04\13 \02\08\17\02\11\04. \34\13 \05\17\14\13\19 \14\05 \20\18 \18\19\14\14\03 \44\00\13\19\00’\18 \18\11\04\08\06\07. \45\07\04 \17\04\08\13\03\04\04\17 \22\04\17\04 \04\23\02\08\19\04\03. \45\07\04\24 \15\17\00\13\02\04\03 \00\13\03 \15\00\02\04\03, \17\08\13\06\08\13\06 \19\07\04 \18\08\11\21\04\17 \18\11\04\08\06\07 \01\04\11\11\18 \19\07\00\19 \07\20\13\06 \05\17\14\12 \19\07\04\08\17 \07\00\17\13\04\18\18\04\18. \34\19 \22\00\18 \00 \12\00\06\08\02\00\11 \18\14\20\13\03, \11\08\10\04 \13\14\19\07\08\13\06 \34’\03 \04\21\04\17 \07\04\00\17\03. \26\02\17\14\18\18 \19\07\04 \02\08\17\02\11\04, \19\07\04 \04\11\21\04\18 \12\14\21\04\03 \00\15\00\17\19 \00\13\03 \44\00\13\19\00 \28\11\00\20\18 \00\15\15\04\00\17\04\03. \45\07\04 \04\11\21\04\18 \02\07\04\04\17\04\03 \22\08\11\03\11\24. + + \33\04 \12\00\17\02\07\04\03 \14\21\04\17 \19\14 \20\18 \00\13\03, \15\14\08\13\19\08\13\06 \19\14 \12\04, \18\00\08\03, “\37\04\19’\18 \07\00\21\04 \19\07\08\18 \05\04\11\11\14\22 \07\04\17\04” \33\04 \09\20\12\15\04\03 \08\13\19\14 \07\08\18 \18\11\04\08\06\07. \45\07\04 \02\14\13\03\20\02\19\14\17 \07\00\13\03\04\03 \12\04 \20\15. \34 \18\00\19 \14\13 \44\00\13\19\00’\18 \10\13\04\04 \00\13\03 \07\04 \00\18\10\04\03, “\39\14\22, \22\07\00\19 \22\14\20\11\03 \24\14\20 \11\08\10\04 \05\14\17 \28\07\17\08\18\19\12\00\18?” + + \34 \10\13\04\22 \19\07\00\19 \34 \02\14\20\11\03 \07\00\21\04 \00\13\24 \06\08\05\19 \34 \02\14\20\11\03 \08\12\00\06\08\13\04. \27\20\19 \19\07\04 \19\07\08\13\06 \34 \22\00\13\19\04\03 \12\14\18\19 \05\14\17 \28\07\17\08\18\19\12\00\18 \22\00\18 \13\14\19 \08\13\18\08\03\04 \44\00\13\19\00’\18 \06\08\00\13\19 \01\00\06. \48\07\00\19 \34 \22\00\13\19\04\03 \12\14\17\04 \19\07\00\13 \00\13\24\19\07\08\13\06 \22\00\18 \14\13\04 \18\08\11\21\04\17 \01\04\11\11 \05\17\14\12 \44\00\13\19\00’\18 \18\11\04\08\06\07. \48\07\04\13 \34 \00\18\10\04\03, \44\00\13\19\00 \18\12\08\11\04\03. \45\07\04\13 \07\04 \06\00\21\04 \12\04 \00 \07\20\06 \00\13\03 \19\14\11\03 \00\13 \04\11\05 \19\14 \02\20\19 \00 \01\04\11\11 \05\17\14\12 \00 \17\04\08\13\03\04\04\17’\18 \07\00\17\13\04\18\18. \45\07\04 \04\11\05 \19\14\18\18\04\03 \08\19 \20\15 \19\14 \44\00\13\19\00. \33\04 \18\19\14\14\03, \07\14\11\03\08\13\06 \19\07\04 \01\04\11\11 \07\08\06\07 \00\01\14\21\04 \07\08\12, \00\13\03 \02\00\11\11\04\03 \14\20\19, “\19\07\04 \05\08\17\18\19 \06\08\05\19 \14\05 \28\07\17\08\18\19\12\00\18!” + + \26 \02\11\14\02\10 \18\19\17\20\02\10 \12\08\03\13\08\06\07\19 \00\18 \19\07\04 \04\11\21\04\18 \17\14\00\17\04\03 \19\07\04\08\17 \00\15\15\17\14\21\00\11. \44\00\13\19\00 \07\00\13\03\04\03 \19\07\04 \01\04\11\11 \19\14 \12\04, \00\13\03 \34 \15\20\19 \08\19 \08\13 \12\24 \01\00\19\07\17\14\01\04 \15\14\02\10\04\19. \45\07\04 \02\14\13\03\20\02\19\14\17 \07\04\11\15\04\03 \12\04 \03\14\22\13 \05\17\14\12 \19\07\04 \18\11\04\08\06\07. \44\00\13\19\00 \18\07\14\20\19\04\03 \14\20\19 \19\07\04 \17\04\08\13\03\04\04\17’\18 \13\00\12\04\18 \00\13\03 \02\17\00\02\10\04\03 \07\08\18 \22\07\08\15. \33\08\18 \19\04\00\12 \02\07\00\17\06\04\03 \05\14\17\22\00\17\03 \00\13\03 \02\11\08\12\01\04\03 \08\13\19\14 \19\07\04 \00\08\17. \44\00\13\19\00 \02\08\17\02\11\04\03 \14\13\02\04 \00\01\14\21\04 \20\18, \19\07\04\13 \03\08\18\00\15\15\04\00\17\04\03 \08\13 \19\07\04 \02\14\11\03, \03\00\17\10 \15\14\11\00\17 \18\10\24. + + \26\18 \18\14\14\13 \00\18 \22\04 \22\04\17\04 \01\00\02\10 \08\13\18\08\03\04 \19\07\04 \41\14\11\00\17 \30\23\15\17\04\18\18, \19\07\04 \14\19\07\04\17 \02\07\08\11\03\17\04\13 \00\18\10\04\03 \19\14 \18\04\04 \19\07\04 \01\04\11\11. \34 \17\04\00\02\07\04\03 \08\13\19\14 \12\24 \15\14\02\10\04\19, \01\20\19 \19\07\04 \14\13\11\24 \19\07\08\13\06 \34 \05\04\11\19 \22\00\18 \00 \07\14\11\04. \34 \07\00\03 \11\14\18\19 \19\07\04 \18\08\11\21\04\17 \01\04\11\11 \05\17\14\12 \44\00\13\19\00 \28\11\00\20\18’\18 \18\11\04\08\06\07. “\37\04\19’\18 \07\20\17\17\24 \14\20\19\18\08\03\04 \00\13\03 \11\14\14\10 \05\14\17 \08\19,” \14\13\04 \14\05 \19\07\04 \02\07\08\11\03\17\04\13 \18\00\08\03. \27\20\19 \19\07\04 \19\17\00\08\13 \06\00\21\04 \00 \18\20\03\03\04\13 \11\20\17\02\07 \00\13\03 \18\19\00\17\19\04\03 \12\14\21\08\13\06. \48\04 \22\04\17\04 \14\13 \14\20\17 \22\00\24 \07\14\12\04. + + \34\19 \01\17\14\10\04 \12\24 \07\04\00\17\19 \19\14 \11\14\18\04 \19\07\04 \01\04\11\11. \48\07\04\13 \19\07\04 \19\17\00\08\13 \17\04\00\02\07\04\03 \12\24 \07\14\20\18\04, \34 \18\00\03\11\24 \11\04\05\19 \19\07\04 \14\19\07\04\17 \02\07\08\11\03\17\04\13. \34 \18\19\14\14\03 \00\19 \12\24 \03\14\14\17\22\00\24 \00\13\03 \22\00\21\04\03 \06\14\14\03-\01\24\04. \45\07\04 \02\14\13\03\20\02\19\14\17 \18\00\08\03 \18\14\12\04\19\07\08\13\06 \05\17\14\12 \19\07\04 \12\14\21\08\13\06 \19\17\00\08\13, \01\20\19 \34 \02\14\20\11\03\13’\19 \07\04\00\17 \07\08\12. “\48\07\00\19?” \34 \24\04\11\11\04\03 \14\20\19. + + \33\04 \02\20\15\15\04\03 \07\08\18 \07\00\13\03\18 \00\17\14\20\13\03 \07\08\18 \12\14\20\19\07. “\38\30\43\43\50 \28\33\43\34\44\45\38\26\44, “\07\04 \18\07\14\20\19\04\03. \45\07\04 \41\14\11\00\17 \30\23\15\17\04\18\18 \11\04\19 \14\20\19 \00 \11\14\20\03 \01\11\00\18\19 \05\17\14\12 \08\19\18 \22\07\08\18\19\11\04 \00\13\03 \18\15\04\03 \00\22\00\24. + + \40\13 \28\07\17\08\18\19\12\00\18 \12\14\17\13\08\13\06 \12\24 \11\08\19\19\11\04 \18\08\18\19\04\17 \44\00\17\00\07 \00\13\03 \34 \14\15\04\13\04\03 \14\20\17 \15\17\04\18\04\13\19\18. \48\07\04\13 \08\19 \11\14\14\10\04\03 \00\18 \08\05 \04\21\04\17\24\19\07\08\13\06 \07\00\03 \01\04\04\13 \20\13\22\17\00\15\15\04\03, \44\00\17\00\07 \05\14\20\13\03 \14\13\04 \11\00\18\19 \18\12\00\11\11 \01\14\23 \01\04\07\08\13\03 \19\07\04 \19\17\04\04. \34\19 \07\00\03 \12\24 \13\00\12\04 \14\13 \08\19. \34\13\18\08\03\04 \22\00\18 \19\07\04 \18\08\11\21\04\17 \01\04\11\11! \45\07\04\17\04 \22\00\18 \00 \13\14\19\04: “\31\14\20\13\03 \19\07\08\18 \14\13 \19\07\04 \18\04\00\19 \14\05 \12\24 \18\11\04\08\06\07. \31\08\23 \19\07\00\19 \07\14\11\04 \08\13 \24\14\20\17 \15\14\02\10\04\19.” \44\08\06\13\04\03, “\38\17. \28.” + + \34 \18\07\14\14\10 \19\07\04 \01\04\11\11. \34\19 \12\00\03\04 \19\07\04 \12\14\18\19 \01\04\00\20\19\08\05\20\11 \18\14\20\13\03 \12\24 \18\08\18\19\04\17 \00\13\03 \34 \07\00\03 \04\21\04\17 \07\04\00\17\03. + + \27\20\19 \12\24 \12\14\19\07\04\17 \18\00\08\03, “\40\07, \19\07\00\19’\18 \19\14\14 \01\00\03.” + + “\50\04\18,” \18\00\08\03 \12\24 \05\00\19\07\04\17, “\08\19’\18 \01\17\14\10\04\13.” + + \48\07\04\13 \34’\03 \18\07\00\10\04\13 \19\07\04 \01\04\11\11, \12\24 \15\00\17\04\13\19\18 \07\00\03 \13\14\19 \07\04\00\17\03 \00 \18\14\20\13\03. diff --git a/public/day/2/small_message_encoded.txt b/public/day/2/small_message_encoded.txt new file mode 100644 index 0000000..bab65ca --- /dev/null +++ b/public/day/2/small_message_encoded.txt @@ -0,0 +1,3 @@ +\33\00\15\15\24 \03\00\24 2! + +\40\13\11\24 23 \12\14\17\04 \03\00\24\18 \20\13\19\08\11 \19\07\04 \28\07\17\08\18\19\12\00\18! diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx new file mode 100644 index 0000000..92aad8f --- /dev/null +++ b/src/components/Navbar.tsx @@ -0,0 +1,40 @@ +import { MdCalendarMonth, MdEventBusy } from "react-icons/md"; +import { Calendar } from "./Calendar"; +import { Link } from "./Link"; + +const { BASE_URL } = import.meta.env; + +interface Props { + day: number; +} + +export function Navbar({ day }: Props) { + return ( +
+
+ LogoWCF +
+ + + + + {/* fullscreen background element that you can click to close when it's open */} +
+
+
+ + +
+
+
+ ); +} diff --git a/src/content/communitySolutions/1/dalurness.md b/src/content/communitySolutions/1/dalurness.md new file mode 100644 index 0000000..a747592 --- /dev/null +++ b/src/content/communitySolutions/1/dalurness.md @@ -0,0 +1,23 @@ +--- +descriptions: ["elixir", "I did another language too!", "and another!"] +--- +```elixir +writeString = case File.read("../letters.txt") do + {:ok, body} -> body + {:error, _reason} -> IO.puts("failed to get file") +end +|> String.split(" ", trim: true) +|> Enum.reduce(Map.new(), fn code, acc -> case Map.has_key?(acc, String.to_integer(code)) do + false -> Map.put(acc, String.to_integer(code), 1) + true -> {_old, newMap} = Map.get_and_update!(acc, String.to_integer(code), fn current_value -> + {current_value, current_value + 1} + end) + newMap + end +end) +|> Enum.sort_by(fn {k,v} -> {v,k} end, :desc) +|> Enum.reduce("", fn {k, v}, acc -> acc <> Integer.to_string(k) <> ": " <> Integer.to_string(v) <> "\n" end) + +{:ok, file} = File.open("output.txt", [:write]) +IO.binwrite(file, writeString) +``` \ No newline at end of file diff --git a/src/content/communitySolutions/2/dalurness.md b/src/content/communitySolutions/2/dalurness.md new file mode 100644 index 0000000..4d6657a --- /dev/null +++ b/src/content/communitySolutions/2/dalurness.md @@ -0,0 +1,29 @@ +--- +descriptions: ["python"] +--- +```python +lowercase = "abcdefghijklmnopqrstuvwxyz" +full_alpha = [l for l in lowercase] + [l.upper() for l in lowercase] + +decode_map = {f"{full_alpha.index(l):02}": l for l in full_alpha} + +writefile = open("output.txt", "w", encoding="utf8") +readfile = open("../small_message_encoded.txt", encoding="utf8") +data = readfile.read() + +i = 0 +while i < len(data): + if data[i] == '\\': + # handle backslashes + if data[i + 1] == '\\': + writefile.write('\\') + else: + code = data[i+1] + data[i+2] + writefile.write(decode_map.get(code)) + i = i + 2 + else: + writefile.write(data[i]) + i = i + 1 +readfile.close() +writefile.close() +``` \ No newline at end of file diff --git a/src/content/config.ts b/src/content/config.ts index 503ea7b..10a61af 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -7,6 +7,14 @@ const daysCollection = defineCollection({ }), }); +const communitySolutionsCollection = defineCollection({ + type: "content", + schema: z.object({ + descriptions: z.array(z.string()), + }), +}) + export const collections = { days: daysCollection, + communitySolutions: communitySolutionsCollection, }; diff --git a/src/content/days/1.md b/src/content/days/1.md index 4e5b074..d59fd85 100644 --- a/src/content/days/1.md +++ b/src/content/days/1.md @@ -1,6 +1,5 @@ --- -title: "Counting Santa's Letters" - +title: "That's a Lot of Letters" --- Do you have any idea how many letters Santa gets each year before Christmas? Millions of people around the world send letters to Santa every year letting him know what they would like for Christmas. However, the logistics of not only reading those letters, but estimating labor, ordering materials, storing products, and loading up presents at the appropriate time in an efficient order requires a lot of planning. diff --git a/src/content/days/2.md b/src/content/days/2.md index 4d2f7b8..729b1c4 100644 --- a/src/content/days/2.md +++ b/src/content/days/2.md @@ -1,25 +1,15 @@ --- title: "Counting Santa's Letters" -resultComponent: "Day2" --- -Do you have any idea how many letters Santa gets each year before Christmas? Millions of people around the world send letters to Santa every year letting him know what they would like for Christmas. However, the logistics of not only reading those letters, but estimating labor, ordering materials, storing products, and loading up presents at the appropriate time in an efficient order requires a lot of planning. +To help keep things efficient at the North Pole, Santa uses a text intercom system to pass messages. But right now that system is bugging out! It isn't correctly decoding messages! -**Problem**: In order to prepare for this Christmas season, some of the head elves would like a report on how many letters are coming from each country. The elves physically receiving the letters have been inputting the country code of the letter into a file named *"letters.txt"*. You need to read this file, and then report how many letters have been sent from each country. +**Problem**: Create a decoder for the following encoding scheme: -**Challeng**: A *"letters_challenge.txt"* has also been included if you'd like some extra credit. There is a lot more data in this file, so it may need to be handled a bit differently so as not to overload your memory. (Note: github has limitations on file size. Feel free to use the python script to make a larger file). +- Alphabetical characters are encoded as a 2 digit number with a prepended "**\\**" +- **a - z** are encoded as **00 - 25** +- **A - Z** are encoded as **26 - 51** +- A "**\\**" is escaped with "**\\\\**" +- Any other characters are left as is (the system Santa uses was made by elves, they hate latin characters so they encoded them) -**Example**: -Input: -``` -1 2 34 53 1 53 6 -``` - -Output: -``` -1: 2 -2: 1 -6: 1 -34: 1 -53: 2 -``` +There are two files: [*"small_message_encoded.txt"*](./small_message_encoded.txt), which you can test on, and [*"large_message_encoded.txt"*](./large_message_encoded.txt), which you should also decode and then share if you can hear "it" to prove you completed the challenge. diff --git a/src/layouts/Day.astro b/src/layouts/Day.astro index 2f83f08..4bb0a57 100644 --- a/src/layouts/Day.astro +++ b/src/layouts/Day.astro @@ -3,65 +3,43 @@ interface Props { day: number; title: string; resultComponent: string; + solutionList: { + username: string; + descriptions: string[]; + }[]; } -import { MdCalendarMonth, MdEventBusy } from "react-icons/md"; -import Layout from "./Layout.astro"; import { DynamicSolution } from "../components/DynamicSolution"; -import { Calendar } from "../components/Calendar"; import { Link } from "../components/Link"; - -const { BASE_URL } = import.meta.env; -const { day, title, resultComponent } = Astro.props; +import Question from "./Question.astro"; +const { day, title, resultComponent, solutionList } = Astro.props; --- - -
-
- LogoWCF - -
- - - - - - - - - -
-
-
- -
-

- Day {day}: {title} -

- -
- -
-
- -
- { - resultComponent && ( - - ) - } -
-
+ {s.username} -{" "} + {s.descriptions.map((s) => ( + + {s} + + ))} + + + )) + } + diff --git a/src/layouts/LayoutNavbar.astro b/src/layouts/LayoutNavbar.astro new file mode 100644 index 0000000..292bf53 --- /dev/null +++ b/src/layouts/LayoutNavbar.astro @@ -0,0 +1,18 @@ +--- +interface Props { + title: string; + day: number; +} + +import Layout from "./Layout.astro"; +import { Navbar } from "../components/Navbar"; + +const { title, day } = Astro.props; +--- + + + +
+ +
+
diff --git a/src/layouts/Question.astro b/src/layouts/Question.astro new file mode 100644 index 0000000..7490607 --- /dev/null +++ b/src/layouts/Question.astro @@ -0,0 +1,18 @@ +--- +interface Props { + day: number; + title: string; +} + +const { day, title } = Astro.props; +--- + +

+ Day {day}: {title} +

+ +
+ +
diff --git a/src/pages/day/[day].astro b/src/pages/day/[day].astro deleted file mode 100644 index 9efb8a3..0000000 --- a/src/pages/day/[day].astro +++ /dev/null @@ -1,22 +0,0 @@ ---- -import { getCollection } from "astro:content"; -import DayLayout from "../../layouts/Day.astro"; - -export async function getStaticPaths() { - const blogEntries = await getCollection("days"); - return blogEntries.map((entry) => ({ - params: { day: entry.slug }, - props: { entry }, - })); -} - -const { entry } = Astro.props; -const { Content } = await entry.render(); - -const day = Number(entry.slug); -const { title } = entry.data; ---- - - - - diff --git a/src/pages/day/[day]/index.astro b/src/pages/day/[day]/index.astro new file mode 100644 index 0000000..eee22c4 --- /dev/null +++ b/src/pages/day/[day]/index.astro @@ -0,0 +1,40 @@ +--- +import { getCollection } from "astro:content"; +import LayoutNavbarLayout from "../../../layouts/LayoutNavbar.astro"; +import DayLayout from "../../../layouts/Day.astro"; + +export async function getStaticPaths() { + const blogEntries = await getCollection("days"); + return blogEntries.map((entry) => ({ + params: { day: entry.slug }, + props: { entry }, + })); +} + +const { entry } = Astro.props; + +const solutions = await getCollection("communitySolutions", ({ id }) => { + return id.startsWith(`${entry.slug}/`); +}); +const solutionList = solutions.map((s) => { + return { + username: s.slug.split("/")[1]!, + descriptions: s.data.descriptions, + }; +}); +const { Content } = await entry.render(); + +const day = Number(entry.slug); +const { title } = entry.data; +--- + + + + + + diff --git a/src/pages/day/[day]/solution/[username].astro b/src/pages/day/[day]/solution/[username].astro new file mode 100644 index 0000000..bc7ca82 --- /dev/null +++ b/src/pages/day/[day]/solution/[username].astro @@ -0,0 +1,48 @@ +--- +import { getCollection } from "astro:content"; +import LayoutNavbarLayout from "../../../../layouts/LayoutNavbar.astro"; +import QuestionLayout from "../../../../layouts/Question.astro"; + +export async function getStaticPaths() { + const blogEntries = await getCollection("days"); + let entries = blogEntries.flatMap(async (dayEntry) => { + const solutions = await getCollection("communitySolutions", ({ id }) => { + return id.startsWith(`${dayEntry.slug}/`); + }); + return solutions.map((entry) => { + let username = entry.slug.split("/")[1]!; + + return { + params: { day: dayEntry.slug, username: username }, + props: { entry, dayEntry, username }, + }; + }); + }); + let pages = await Promise.all(entries); + return pages.flatMap((p) => p); +} + +const { entry, dayEntry, username } = Astro.props; +const day = Number(dayEntry.slug); +const { title } = dayEntry.data; +const { Content: QuestionContent } = await dayEntry.render(); +const { Content } = await entry.render(); +--- + + +
+

+ {username}'s Solution +

+
+ +
+
+ + + +