sln_2017_24
Copyright(c) Eric Mertens 2017
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellNone
LanguageHaskell2010

Main

Description

https://adventofcode.com/2017/day/24

Build long bridges out of pieces with a pin count on each end. Pieces can be flipped over and to be connected the pin counts of two pieces must match.

Synopsis

Documentation

main :: IO () Source #

Print solutions to both parts of the task.

orient Source #

Arguments

:: Int

target left pin count

-> (Int, Int)

current piece

-> [(Int, Int)]

possible orientations of this piece

Given a required number of ports and a piece, return the possible unique orientations of that piece.

search Source #

Arguments

:: Int

current bridge length

-> Int

current bridge weight

-> Int

required port pins

-> [(Int, Int)]

available pieces

-> [(Int, Int)]

length and weight of possible bridges

Generate statistics for all of the possible bridges given some pieces.