13
Designing a Programming Language to Speedrun Advent of Code
(blog.vero.site)
I would have liked to see a nice clear example at the top to help me decide if I really want to read about the language.
EDIT: First sample:
day := 1;
import "advent-prelude.noul";
puzzle_input := advent_input();
submit! 1, puzzle_input split "\n\n" map ints map sum then max;
submit! 2, puzzle_input split "\n\n" map ints map sum then sort then (_[-3:]) then sum;
Looks not too different from what you might do in Factor:
: totals ( -- seq )
puzzle-input "\n\n" split-subseq [ split-lines [ string>number ] map-sum ] map
;
: part1 ( -- ) totals supremum . ;
: part2 ( -- ) totals sort 3 tail* sum . ;
An unofficial home for the advent of code community on programming.dev! Other challenges are also welcome!
Advent of Code is an annual Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.
Everybody Codes is another collection of programming puzzles with seasonal events.
Solution Threads
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 |
Icon base by Lorc under CC BY 3.0 with modifications to add a gradient
console.log('Hello World')