sln_2021_17
Copyright(c) Eric Mertens 2021
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellNone
LanguageHaskell2010

Main

Description

https://adventofcode.com/2021/day/17

Launch probes to hit a target.

This solution relies on the target being in quadrant IV. You could do the math for the other quadrants, but I didn't bother!

Boundary conditions:

  • x velocity must be non-negative to hit things in quadrant IV
  • x velocity must not be more than xhi or the probe will miss on the first timestep.
  • y velocity can't be more than ylo or it will miss on the first time step.
  • y velocity can't be more than -ylo or it will skip right past the target on its way back down.
Synopsis

Documentation

main :: IO () Source #

>>> :main
10585
5247