Commit Graph
64 Commits
Author SHA1 Message Date
ryan b9a36a476a brute force day 16.1 with incorrect algorithm lol
it gets the right answer for the input but not for the example input
2023-11-21 18:17:35 -08:00
ryan 8270ee7aa8 never touching day 15 ever again 2023-11-21 16:50:51 -08:00
ryan 894e83fe12 fix day 15 for example inputs
part 1 didn't work for the example input :(
2023-11-21 16:48:03 -08:00
ryan 11546bff5f fix ocamlformat
apparently `version = x` simply refuses to format if you dont have the
specified version. doesn't seem very useful for a repo like this.
2023-11-21 16:47:17 -08:00
ryan d1e69ba66e cosmetic refactoring for day 15 2023-11-20 18:57:00 -08:00
ryan 2887274ad9 update the comment in day 15.1 2023-11-20 18:34:44 -08:00
ryan 6758130700 speed up day 15.1 with intersections
also update the vec module to use Iter in some places
2023-11-20 18:26:55 -08:00
ryan ff4bb0ae89 simplify day 15 parsing with regex 2023-11-20 14:26:01 -08:00
ryan b69f867423 update opam file 2023-11-20 14:25:38 -08:00
ryan a652ec69da add memo wrapper for recursive functions 2023-11-20 14:11:04 -08:00
rmanseau 421616a282 add dev env packages to depends 2023-11-20 13:36:40 -08:00
rmanseau f775ed645b fix opam file and add install steps to README 2023-11-20 12:24:23 -08:00
ryan 705c9e9a7c faster 15.2 solution with line intersections :/ 2023-11-10 18:24:41 -08:00
ryan 8d97e7601c very slow solution to day 15 part 2 :)
could be sped up by doing math to find intesections points of the
borders but that sounds boring
2023-11-09 14:23:41 -08:00
ryan b89e9c05ef refac day 14 to use new Vec2.bounds function 2023-11-08 10:37:44 -08:00
ryan b90478cd03 solve day 15 part 1 ! 2023-11-08 10:37:31 -08:00
ryan 383c6c0fca add Vec2.iter_region 2023-11-08 10:36:33 -08:00
ryan 19a763b73f manually implement show & pp for Vec2
so that it prints as if it were a tuple
2023-11-08 09:14:22 -08:00
ryan dcb1338aa3 parse day 15 2023-11-08 09:14:00 -08:00
ryan 724576d120 refactor day 14 a bit 2023-11-01 14:40:16 -07:00
ryan ceaebf895d solve day 14! 2023-11-01 14:14:46 -07:00
ryan ceb0f04a78 implement sand dropping logic & pretty visuals 2023-11-01 12:10:15 -07:00
ryan c5c9b584c0 update Grid.%() operator to return option 2023-11-01 12:09:53 -07:00
ryan 80f29ae00e swap Vec2 up/down
going down on the grid increases the int for y
2023-11-01 12:08:43 -07:00
ryan 2418d2ff0d normalize points in input
this way i can print the full input in as small a space as possible!
2023-10-31 18:06:12 -07:00
ryan 1ca2a95e1d make Grid.set_e throw out of bounds errors 2023-10-31 18:05:10 -07:00
ryan 61e3520ede parse day 14 grid
haven't implemented the falling sand yet, but theres a cool expect test
that draws the grid
2023-10-31 17:04:20 -07:00
ryan 98f47654f8 change Vec2 implementation to a record type 2023-10-31 15:57:13 -07:00
ryan 88acb381f1 move Grid into its own file 2023-10-31 15:57:11 -07:00
ryan 1d60878428 add init_grid func 2023-10-31 14:43:12 -07:00
ryan 63bad67c1b create angstrom wrapper in Utils for int parser
and other common parsers for the future
2023-10-31 14:40:22 -07:00
ryan 8fe7e77b52 put packet in a inline module cuz why not 2023-10-31 10:08:20 -07:00
ryan 06f695b34c tighten up day 13
List.compare is neat!
2023-10-31 09:45:04 -07:00
ryan fa8970b0de day 13, first parser combinator! thx angstrom <3 2023-10-30 15:37:45 -07:00
ryan dfa2cf11a1 add Vec2.origin for (0,0) 2023-10-30 11:21:34 -07:00
ryan 8562bc8385 finished day 12, thx dijkstra !! 2023-10-23 19:49:18 -05:00
ryan 887d961d29 flatten array of array in grid implementation
makes the new find function much simpler to implement
2023-10-22 11:43:27 -05:00
ryan 31a75867fa add expect tests 2023-10-09 14:14:13 -07:00
ryan b6eae27d9d get rid of executable
expect tests will make them kinda pointless
2023-10-09 14:14:06 -07:00
ryan fe5cd3666f move grid parse & iter into Vec2 2023-10-09 13:58:53 -07:00
ryan 250d978a38 solve day 11 :) 2023-10-08 19:10:12 -07:00
ryan c93c273ffd solve day 10 2023-10-07 12:58:57 -07:00
ryan bf5d3c1656 clean up vec stuff 2023-10-07 12:58:50 -07:00
ryan 1ee3a5a3c5 solve day 9 :) 2023-10-05 15:56:02 -07:00
ryan 5e1c30637e move vec2 into a new file & add a pretty printer
now it shows up properly in utop !!
2023-10-05 15:55:05 -07:00
ryan 239af2f93b refactor day 8 a bit 2023-10-01 13:12:36 -07:00
ryan 7d6b43ba93 day 8 complete ! 2023-10-01 01:55:36 -07:00
ryan b7aabdedcb dont let warnings fail the build >:( 2023-10-01 01:54:23 -07:00
ryan 3d2a2f2c4d added comment & got rid of match%pcre 2023-09-30 23:20:47 -07:00
ryan 1fdb1ebc36 solved day 7 !! 2023-09-30 19:15:28 -07:00