f4e3c645ab | 5 years ago | |
---|---|---|
.. | ||
01.rkt | 5 years ago | |
01.rktd | 5 years ago | |
02.rkt | 5 years ago | |
02.rktd | 5 years ago | |
03.rkt | 5 years ago | |
03.rktd | 5 years ago | |
04.rkt | 5 years ago | |
04.rktd | 5 years ago | |
05.rkt | 5 years ago | |
05.rktd | 5 years ago | |
06.rkt | 5 years ago | |
06.rktd | 5 years ago | |
07-gen.rkt | 5 years ago | |
07.rkt | 5 years ago | |
07.rktd | 5 years ago | |
08.rkt | 5 years ago | |
08.rktd | 5 years ago | |
09.rkt | 5 years ago | |
09.rktd | 5 years ago | |
README.md | 5 years ago |
README.md
MB’s Advent of Code tips
-
Complex numbers are a nice way of modeling two-dimensional positions.
-
Use lists whenever feasible, because there are many useful list functions in the Racket library that don’t have vector equivalents.
-
In particular, these list functions are very useful.
-
eq?
is the fastest equality check, but it only works for symbols and fixnums (therefore, use more symbols and fixnums so you can useeq?
!) -
match
is fantastic. -
Association lists (= lists of pairs) can be used with the dictionary forms (like
dict-ref
andin-dict
) -
The
graph
library can be useful for graph-based problems.
My solutions
-
I try to write solutions that are succinct but not cryptic.
-
I don’t optimize for speed.
-
I like doing the Advent of Code problems because it forces me to use parts of Racket that I don’t ordinarily use. So I treat it as a chance to expand my awareness of the Racketverse.