From: Neil Smith Date: Fri, 29 Nov 2019 14:03:14 +0000 (+0000) Subject: Done day 25 X-Git-Url: https://git.njae.me.uk/?p=advent-of-code-18.git;a=commitdiff_plain Done day 25 --- diff --git a/advent-of-code.cabal b/advent-of-code.cabal index 61d8e63..b30d8df 100644 --- a/advent-of-code.cabal +++ b/advent-of-code.cabal @@ -299,3 +299,14 @@ executable advent24naive , containers , text , megaparsec + + +executable advent25 + hs-source-dirs: src/advent25 + main-is: advent25.hs + default-language: Haskell2010 + build-depends: base >= 4.7 && < 5 + , containers + , text + , megaparsec + , linear diff --git a/data/advent25.txt b/data/advent25.txt new file mode 100644 index 0000000..2e1a237 --- /dev/null +++ b/data/advent25.txt @@ -0,0 +1,1037 @@ +-8,6,3,-5 +-7,-2,5,1 +-3,-8,1,5 +-5,1,5,6 +-3,7,-4,8 +-8,3,-8,-3 +-4,8,2,-7 +0,-5,-7,8 +6,0,0,-3 +6,4,-7,-8 +5,-3,-6,-8 +-7,-5,-7,0 +-2,-8,2,5 +-2,-5,-5,-6 +-3,8,-1,6 +7,6,7,-6 +-5,-6,0,-3 +-5,7,-4,0 +-1,-3,1,2 +8,1,0,5 +5,-3,-5,-7 +-3,0,2,1 +-4,-4,2,5 +8,4,-1,5 +1,-1,-4,6 +3,3,-8,0 +-2,8,-5,-5 +1,-6,-8,8 +-7,7,-5,2 +3,3,1,-3 +0,3,4,-4 +8,5,-5,6 +-7,-5,-7,-7 +4,-5,2,0 +-5,8,-5,8 +4,-7,2,-5 +7,7,3,1 +-1,-5,-6,-4 +1,0,6,-6 +-7,-5,-3,8 +-2,-7,-8,8 +7,3,-8,-4 +2,3,-6,5 +-3,-7,0,6 +-8,7,5,4 +5,-3,3,-3 +0,2,4,5 +-8,-2,0,-6 +0,1,0,-2 +-6,1,-7,3 +-4,-4,-7,-1 +-8,4,-4,-4 +0,7,-2,-3 +8,0,-8,-7 +0,0,3,1 +0,-7,-8,3 +7,8,8,6 +1,2,5,5 +2,5,-4,-4 +-7,-2,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2 +5,6,2,0 +6,6,5,-1 +-2,1,-5,7 +-7,-4,1,-6 +-4,7,-5,3 +8,5,-4,4 +1,8,-5,1 +2,2,0,0 +8,1,-8,8 +5,8,-8,7 +-6,6,-5,-4 +0,-5,-7,-3 +-3,7,7,-4 +0,-3,8,-5 +1,-5,-2,8 +-4,-1,-8,0 +3,-5,7,3 +-7,-7,0,-8 +-2,5,-8,7 +-8,-5,-7,1 +1,4,0,5 +4,-1,-1,-8 +-7,4,-2,-2 +-2,7,-4,-4 +1,8,0,4 +-1,-2,-3,2 +-1,1,-2,-2 +-2,1,5,-5 diff --git a/data/advent25a.txt b/data/advent25a.txt new file mode 100644 index 0000000..3089dd5 --- /dev/null +++ b/data/advent25a.txt @@ -0,0 +1,8 @@ +0,0,0,0 +3,0,0,0 +0,3,0,0 +0,0,3,0 +0,0,0,3 +0,0,0,6 +9,0,0,0 +12,0,0,0 diff --git a/problems/day24.html b/problems/day24.html new file mode 100644 index 0000000..76eea55 --- /dev/null +++ b/problems/day24.html @@ -0,0 +1,402 @@ + + + + +Day 24 - Advent of Code 2018 + + + + + + + +

Advent of Code

Neil Smith (AoC++) 48*

   int y=2018;

+ + + +
+

--- Day 24: Immune System Simulator 20XX ---

After a weird buzzing noise, you appear back at the man's cottage. He seems relieved to see his friend, but quickly notices that the little reindeer caught some kind of cold while out exploring.

+

The portly man explains that this reindeer's immune system isn't similar to regular reindeer immune systems:

+

The immune system and the infection each have an army made up of several groups; each group consists of one or more identical units. The armies repeatedly fight until only one army has units remaining.

+

Units within a group all have the same hit points (amount of damage a unit can take before it is destroyed), attack damage (the amount of damage each unit deals), an attack type, an initiative (higher initiative units attack first and win ties), and sometimes weaknesses or immunities. Here is an example group:

+
18 units each with 729 hit points (weak to fire; immune to cold, slashing)
+ with an attack that does 8 radiation damage at initiative 10
+
+

Each group also has an effective power: the number of units in that group multiplied by their attack damage. The above group has an effective power of 18 * 8 = 144. Groups never have zero or negative units; instead, the group is removed from combat.

+

Each fight consists of two phases: target selection and attacking.

+

During the target selection phase, each group attempts to choose one target. In decreasing order of effective power, groups choose their targets; in a tie, the group with the higher initiative chooses first. The attacking group chooses to target the group in the enemy army to which it would deal the most damage (after accounting for weaknesses and immunities, but not accounting for whether the defending group has enough units to actually receive all of that damage).

+

If an attacking group is considering two defending groups to which it would deal equal damage, it chooses to target the defending group with the largest effective power; if there is still a tie, it chooses the defending group with the highest initiative. If it cannot deal any defending groups damage, it does not choose a target. Defending groups can only be chosen as a target by one attacking group.

+

At the end of the target selection phase, each group has selected zero or one groups to attack, and each group is being attacked by zero or one groups.

+

During the attacking phase, each group deals damage to the target it selected, if any. Groups attack in decreasing order of initiative, regardless of whether they are part of the infection or the immune system. (If a group contains no units, it cannot attack.)

+

The damage an attacking group deals to a defending group depends on the attacking group's attack type and the defending group's immunities and weaknesses. By default, an attacking group would deal damage equal to its effective power to the defending group. However, if the defending group is immune to the attacking group's attack type, the defending group instead takes no damage; if the defending group is weak to the attacking group's attack type, the defending group instead takes double damage.

+

The defending group only loses whole units from damage; damage is always dealt in such a way that it kills the most units possible, and any remaining damage to a unit that does not immediately kill it is ignored. For example, if a defending group contains 10 units with 10 hit points each and receives 75 damage, it loses exactly 7 units and is left with 3 units at full health.

+

After the fight is over, if both armies still contain units, a new fight begins; combat only ends once one army has lost all of its units.

+

For example, consider the following armies:

+
Immune System:
+17 units each with 5390 hit points (weak to radiation, bludgeoning) with
+ an attack that does 4507 fire damage at initiative 2
+989 units each with 1274 hit points (immune to fire; weak to bludgeoning,
+ slashing) with an attack that does 25 slashing damage at initiative 3
+
+Infection:
+801 units each with 4706 hit points (weak to radiation) with an attack
+ that does 116 bludgeoning damage at initiative 1
+4485 units each with 2961 hit points (immune to radiation; weak to fire,
+ cold) with an attack that does 12 slashing damage at initiative 4
+
+

If these armies were to enter combat, the following fights, including details during the target selection and attacking phases, would take place:

+
Immune System:
+Group 1 contains 17 units
+Group 2 contains 989 units
+Infection:
+Group 1 contains 801 units
+Group 2 contains 4485 units
+
+Infection group 1 would deal defending group 1 185832 damage
+Infection group 1 would deal defending group 2 185832 damage
+Infection group 2 would deal defending group 2 107640 damage
+Immune System group 1 would deal defending group 1 76619 damage
+Immune System group 1 would deal defending group 2 153238 damage
+Immune System group 2 would deal defending group 1 24725 damage
+
+Infection group 2 attacks defending group 2, killing 84 units
+Immune System group 2 attacks defending group 1, killing 4 units
+Immune System group 1 attacks defending group 2, killing 51 units
+Infection group 1 attacks defending group 1, killing 17 units
+
+
Immune System:
+Group 2 contains 905 units
+Infection:
+Group 1 contains 797 units
+Group 2 contains 4434 units
+
+Infection group 1 would deal defending group 2 184904 damage
+Immune System group 2 would deal defending group 1 22625 damage
+Immune System group 2 would deal defending group 2 22625 damage
+
+Immune System group 2 attacks defending group 1, killing 4 units
+Infection group 1 attacks defending group 2, killing 144 units
+
+
Immune System:
+Group 2 contains 761 units
+Infection:
+Group 1 contains 793 units
+Group 2 contains 4434 units
+
+Infection group 1 would deal defending group 2 183976 damage
+Immune System group 2 would deal defending group 1 19025 damage
+Immune System group 2 would deal defending group 2 19025 damage
+
+Immune System group 2 attacks defending group 1, killing 4 units
+Infection group 1 attacks defending group 2, killing 143 units
+
+
Immune System:
+Group 2 contains 618 units
+Infection:
+Group 1 contains 789 units
+Group 2 contains 4434 units
+
+Infection group 1 would deal defending group 2 183048 damage
+Immune System group 2 would deal defending group 1 15450 damage
+Immune System group 2 would deal defending group 2 15450 damage
+
+Immune System group 2 attacks defending group 1, killing 3 units
+Infection group 1 attacks defending group 2, killing 143 units
+
+
Immune System:
+Group 2 contains 475 units
+Infection:
+Group 1 contains 786 units
+Group 2 contains 4434 units
+
+Infection group 1 would deal defending group 2 182352 damage
+Immune System group 2 would deal defending group 1 11875 damage
+Immune System group 2 would deal defending group 2 11875 damage
+
+Immune System group 2 attacks defending group 1, killing 2 units
+Infection group 1 attacks defending group 2, killing 142 units
+
+
Immune System:
+Group 2 contains 333 units
+Infection:
+Group 1 contains 784 units
+Group 2 contains 4434 units
+
+Infection group 1 would deal defending group 2 181888 damage
+Immune System group 2 would deal defending group 1 8325 damage
+Immune System group 2 would deal defending group 2 8325 damage
+
+Immune System group 2 attacks defending group 1, killing 1 unit
+Infection group 1 attacks defending group 2, killing 142 units
+
+
Immune System:
+Group 2 contains 191 units
+Infection:
+Group 1 contains 783 units
+Group 2 contains 4434 units
+
+Infection group 1 would deal defending group 2 181656 damage
+Immune System group 2 would deal defending group 1 4775 damage
+Immune System group 2 would deal defending group 2 4775 damage
+
+Immune System group 2 attacks defending group 1, killing 1 unit
+Infection group 1 attacks defending group 2, killing 142 units
+
+
Immune System:
+Group 2 contains 49 units
+Infection:
+Group 1 contains 782 units
+Group 2 contains 4434 units
+
+Infection group 1 would deal defending group 2 181424 damage
+Immune System group 2 would deal defending group 1 1225 damage
+Immune System group 2 would deal defending group 2 1225 damage
+
+Immune System group 2 attacks defending group 1, killing 0 units
+Infection group 1 attacks defending group 2, killing 49 units
+
+
Immune System:
+No groups remain.
+Infection:
+Group 1 contains 782 units
+Group 2 contains 4434 units
+
+

In the example above, the winning army ends up with 782 + 4434 = 5216 units.

+

You scan the reindeer's condition (your puzzle input); the white-bearded man looks nervous. As it stands now, how many units would the winning army have?

+
+

Your puzzle answer was 15493.

--- Part Two ---

Things aren't looking good for the reindeer. The man asks whether more milk and cookies would help you think.

+

If only you could give the reindeer's immune system a boost, you might be able to change the outcome of the combat.

+

A boost is an integer increase in immune system units' attack damage. For example, if you were to boost the above example's immune system's units by 1570, the armies would instead look like this:

+
Immune System:
+17 units each with 5390 hit points (weak to radiation, bludgeoning) with
+ an attack that does 6077 fire damage at initiative 2
+989 units each with 1274 hit points (immune to fire; weak to bludgeoning,
+ slashing) with an attack that does 1595 slashing damage at initiative 3
+
+Infection:
+801 units each with 4706 hit points (weak to radiation) with an attack
+ that does 116 bludgeoning damage at initiative 1
+4485 units each with 2961 hit points (immune to radiation; weak to fire,
+ cold) with an attack that does 12 slashing damage at initiative 4
+
+

With this boost, the combat proceeds differently:

+
Immune System:
+Group 2 contains 989 units
+Group 1 contains 17 units
+Infection:
+Group 1 contains 801 units
+Group 2 contains 4485 units
+
+Infection group 1 would deal defending group 2 185832 damage
+Infection group 1 would deal defending group 1 185832 damage
+Infection group 2 would deal defending group 1 53820 damage
+Immune System group 2 would deal defending group 1 1577455 damage
+Immune System group 2 would deal defending group 2 1577455 damage
+Immune System group 1 would deal defending group 2 206618 damage
+
+Infection group 2 attacks defending group 1, killing 9 units
+Immune System group 2 attacks defending group 1, killing 335 units
+Immune System group 1 attacks defending group 2, killing 32 units
+Infection group 1 attacks defending group 2, killing 84 units
+
+
Immune System:
+Group 2 contains 905 units
+Group 1 contains 8 units
+Infection:
+Group 1 contains 466 units
+Group 2 contains 4453 units
+
+Infection group 1 would deal defending group 2 108112 damage
+Infection group 1 would deal defending group 1 108112 damage
+Infection group 2 would deal defending group 1 53436 damage
+Immune System group 2 would deal defending group 1 1443475 damage
+Immune System group 2 would deal defending group 2 1443475 damage
+Immune System group 1 would deal defending group 2 97232 damage
+
+Infection group 2 attacks defending group 1, killing 8 units
+Immune System group 2 attacks defending group 1, killing 306 units
+Infection group 1 attacks defending group 2, killing 29 units
+
+
Immune System:
+Group 2 contains 876 units
+Infection:
+Group 2 contains 4453 units
+Group 1 contains 160 units
+
+Infection group 2 would deal defending group 2 106872 damage
+Immune System group 2 would deal defending group 2 1397220 damage
+Immune System group 2 would deal defending group 1 1397220 damage
+
+Infection group 2 attacks defending group 2, killing 83 units
+Immune System group 2 attacks defending group 2, killing 427 units
+
+

After a few fights...

+
Immune System:
+Group 2 contains 64 units
+Infection:
+Group 2 contains 214 units
+Group 1 contains 19 units
+
+Infection group 2 would deal defending group 2 5136 damage
+Immune System group 2 would deal defending group 2 102080 damage
+Immune System group 2 would deal defending group 1 102080 damage
+
+Infection group 2 attacks defending group 2, killing 4 units
+Immune System group 2 attacks defending group 2, killing 32 units
+
+
Immune System:
+Group 2 contains 60 units
+Infection:
+Group 1 contains 19 units
+Group 2 contains 182 units
+
+Infection group 1 would deal defending group 2 4408 damage
+Immune System group 2 would deal defending group 1 95700 damage
+Immune System group 2 would deal defending group 2 95700 damage
+
+Immune System group 2 attacks defending group 1, killing 19 units
+
+
Immune System:
+Group 2 contains 60 units
+Infection:
+Group 2 contains 182 units
+
+Infection group 2 would deal defending group 2 4368 damage
+Immune System group 2 would deal defending group 2 95700 damage
+
+Infection group 2 attacks defending group 2, killing 3 units
+Immune System group 2 attacks defending group 2, killing 30 units
+
+

After a few more fights...

+
Immune System:
+Group 2 contains 51 units
+Infection:
+Group 2 contains 40 units
+
+Infection group 2 would deal defending group 2 960 damage
+Immune System group 2 would deal defending group 2 81345 damage
+
+Infection group 2 attacks defending group 2, killing 0 units
+Immune System group 2 attacks defending group 2, killing 27 units
+
+
Immune System:
+Group 2 contains 51 units
+Infection:
+Group 2 contains 13 units
+
+Infection group 2 would deal defending group 2 312 damage
+Immune System group 2 would deal defending group 2 81345 damage
+
+Infection group 2 attacks defending group 2, killing 0 units
+Immune System group 2 attacks defending group 2, killing 13 units
+
+
Immune System:
+Group 2 contains 51 units
+Infection:
+No groups remain.
+
+

This boost would allow the immune system's armies to win! It would be left with 51 units.

+

You don't even know how you could boost the reindeer's immune system or what effect it might have, so you need to be cautious and find the smallest boost that would allow the immune system to win.

+

How many units does the immune system have left after getting the smallest boost it needs to win?

+
+

Your puzzle answer was 1045.

Both parts of this puzzle are complete! They provide two gold stars: **

+

At this point, you should return to your Advent calendar and try another puzzle.

+

If you still want to see it, you can get your puzzle input.

+

You can also this puzzle.

+
+ + + + + + \ No newline at end of file diff --git a/problems/day25.html b/problems/day25.html new file mode 100644 index 0000000..8f3a053 --- /dev/null +++ b/problems/day25.html @@ -0,0 +1,185 @@ + + + + +Day 25 - Advent of Code 2018 + + + + + + + +

Advent of Code

Neil Smith (AoC++) 50*

 {'year':2018}

+ + + +
+

--- Day 25: Four-Dimensional Adventure ---

The reindeer's symptoms are getting worse, and neither you nor the white-bearded man have a solution. At least the reindeer has a warm place to rest: a small bed near where you're sitting.

+

As you reach down, the reindeer looks up at you, accidentally bumping a button on your wrist-mounted device with its nose in the process - a button labeled "help".

+

"Hello, and welcome to the Time Travel Support Hotline! If you are lost in time and space, press 1. If you are trapped in a time paradox, press 2. If you need help caring for a sick reindeer, press 3. If you--"

+

Beep.

+

A few seconds later, you hear a new voice. "Hello; please state the nature of your reindeer." You try to describe the situation.

+

"Just a moment, I think I can remotely run a diagnostic scan." A beam of light projects from the device and sweeps over the reindeer a few times.

+

"Okay, it looks like your reindeer is very low on magical energy; it should fully recover if we can fix that. Let me check your timeline for a source.... Got one. There's actually a powerful source of magical energy about 1000 years forward from you, and at roughly your position, too! It looks like... hot chocolate? Anyway, you should be able to travel there to pick some up; just don't forget a mug! Is there anything else I can help you with today?"

+

You explain that your device isn't capable of going forward in time. "I... see. That's tricky. Well, according to this information, your device should have the necessary hardware to open a small portal and send some hot chocolate back to you. You'll need a list of fixed points in spacetime; I'm transmitting it to you now."

+

"You just need to align your device to the constellations of fixed points so that it can lock on to the destination and open the portal. Let me look up how much hot chocolate that breed of reindeer needs."

+

"It says here that your particular reindeer is-- this can't be right, it says there's only one like that in the universe! But THAT means that you're--" You disconnect the call.

+

The list of fixed points in spacetime (your puzzle input) is a set of four-dimensional coordinates. To align your device, acquire the hot chocolate, and save the reindeer, you just need to find the number of constellations of points in the list.

+

Two points are in the same constellation if their manhattan distance apart is no more than 3 or if they can form a chain of points, each a manhattan distance no more than 3 from the last, between the two of them. (That is, if a point is close enough to a constellation, it "joins" that constellation.) For example:

+
 0,0,0,0
+ 3,0,0,0
+ 0,3,0,0
+ 0,0,3,0
+ 0,0,0,3
+ 0,0,0,6
+ 9,0,0,0
+12,0,0,0
+
+

In the above list, the first six points form a single constellation: 0,0,0,0 is exactly distance 3 from the next four, and the point at 0,0,0,6 is connected to the others by being 3 away from 0,0,0,3, which is already in the constellation. The bottom two points, 9,0,0,0 and 12,0,0,0 are in a separate constellation because no point is close enough to connect them to the first constellation. So, in the above list, the number of constellations is 2. (If a point at 6,0,0,0 were present, it would connect 3,0,0,0 and 9,0,0,0, merging all of the points into a single giant constellation instead.)

+

In this example, the number of constellations is 4:

+
-1,2,2,0
+0,0,2,-2
+0,0,0,-2
+-1,2,0,0
+-2,-2,-2,2
+3,0,2,-1
+-1,3,2,2
+-1,0,-1,0
+0,2,1,-2
+3,0,0,0
+
+

In this one, it's 3:

+
1,-1,0,1
+2,0,-1,0
+3,2,-1,0
+0,0,3,1
+0,0,-1,-1
+2,3,-2,0
+-2,2,0,0
+2,-2,0,-1
+1,-1,0,-1
+3,2,0,2
+
+

Finally, in this one, it's 8:

+
1,-1,-1,-2
+-2,-2,0,1
+0,2,1,3
+-2,3,-2,1
+0,2,3,-2
+-1,-1,1,-2
+0,-2,-1,0
+-2,2,3,-1
+1,2,2,0
+-1,-2,0,-2
+
+

The portly man nervously strokes his white beard. It's time to get that hot chocolate.

+

How many constellations are formed by the fixed points in spacetime?

+
+

Your puzzle answer was 422.

--- Part Two ---

A small glowing portal opens above the mug you prepared and just enough hot chocolate streams in to fill it. You suspect the reindeer has never encountered hot chocolate before, but seems to enjoy it anyway. You hope it works.

+

It's time to start worrying about that integer underflow in time itself you set up a few days ago. You check the status of the device: "Insufficient chronal energy for activation. Energy required: 50 stars."

+

The reindeer bumps the device with its nose.

+

"Energy required: 49 stars."

+
+

If you like, you can .

+

Both parts of this puzzle are complete! They provide two gold stars: **

+

At this point, all that is left is for you to admire your Advent calendar.

+

If you still want to see it, you can get your puzzle input.

+

You can also this puzzle.

+
+ + + + + + \ No newline at end of file diff --git a/src/advent25/advent25.hs b/src/advent25/advent25.hs new file mode 100644 index 0000000..5cbd71f --- /dev/null +++ b/src/advent25/advent25.hs @@ -0,0 +1,104 @@ +{-# LANGUAGE NegativeLiterals #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE TypeFamilies #-} + +import Debug.Trace + +-- import Prelude hiding ((++)) +import Data.Text (Text) +import qualified Data.Text as T +import qualified Data.Text.IO as TIO + +import Data.Void (Void) +import Text.Megaparsec hiding (State) +import Text.Megaparsec.Char +import qualified Text.Megaparsec.Char.Lexer as L +import qualified Control.Applicative as CA + +import Data.List hiding (group) +-- import Data.Function (on) +import qualified Data.Map.Strict as M +import Data.Map.Strict ((!)) + +import Linear (V4(..), (^-^)) + + +type Coord = V4 Integer +type Constellations = M.Map Coord Coord + + +main :: IO () +main = do + text <- TIO.readFile "data/advent25.txt" + let stars = successfulParse text + print $ part1 stars + + +part1 :: [Coord] -> Int +part1 stars = countConstellations constellations + where initialConstellations = foldl' (\c s -> M.insert s s c) M.empty stars + pairs = adjacencies stars + constellations = findConstellations initialConstellations pairs + + +manhattan :: Coord -> Integer +manhattan (V4 x y z t) = (abs x) + (abs y) + (abs z) + (abs t) + +distance :: Coord -> Coord -> Integer +distance a b = manhattan (a ^-^ b) + +close :: Coord -> Coord -> Bool +close a b = (distance a b) <= 3 + +adjacencies :: [Coord] -> [(Coord, Coord)] +adjacencies stars = filter (\(a, b) -> a /= b && (close a b)) + [ (a, b) | a <- stars, b <- stars ] + + +findConstellations :: Constellations -> [(Coord, Coord)] -> Constellations +findConstellations constellations0 pairs = foldl' mergeConstellation constellations0 pairs + +mergeConstellation :: Constellations -> (Coord, Coord) -> Constellations +mergeConstellation constellations (a, b) = + if ae == be + then constellations + else M.insert ae be constellations + where ae = exemplar constellations a + be = exemplar constellations b + +exemplar :: Constellations -> Coord -> Coord +exemplar constellations star = + if constellations!star == star + then star + else exemplar constellations (constellations!star) + + +countConstellations :: Constellations -> Int +countConstellations constellations = M.size $ M.filterWithKey (==) constellations + + +type Parser = Parsec Void Text + +sc :: Parser () +sc = L.space (skipSome spaceChar) CA.empty CA.empty + +lexeme = L.lexeme sc +integer = lexeme L.decimal +signedInteger = L.signed sc integer +symb = L.symbol sc +comma = symb "," + +coordP = V4 <$> signedInteger <* comma + <*> signedInteger <* comma + <*> signedInteger <* comma + <*> signedInteger + +starsP = many coordP + +successfulParse :: Text -> [Coord] +-- successfulParse _ = [] +successfulParse input = + case parse starsP "input" input of + Left _error -> [] -- TIO.putStr $ T.pack $ parseErrorPretty err + Right stars -> stars