Skip to content
This repository has been archived by the owner on Nov 17, 2024. It is now read-only.

Commit

Permalink
more thoughts for day 24
Browse files Browse the repository at this point in the history
  • Loading branch information
mstksg committed Dec 25, 2023
1 parent 33fb74d commit 6b6beb9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/AOC/Challenge/Day24.hs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ day24a =
-- r0x - t1 v1x + t1vx = r1x
-- r0y - t1 v1y + t1vy = r1y
-- r0z - t1 v1z + t1vz = r1z
--
-- wait...can we do a trick, shift to the CoM frame? i'm not sure if the CoM
-- is itself magical here (ie, the CoM is literally the magic spot?) but maybe
-- it can make things easier.
--
-- actually let's just guess the CoM first. nope that doesn't work.
--

day24b :: _ :~> _
Expand All @@ -204,5 +210,7 @@ day24b =
sShow = show,
sSolve =
noFail $
id
sum . com . map (view _x)
}
where
com xs = fmap (`div` length xs ) $ sum xs

0 comments on commit 6b6beb9

Please sign in to comment.