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

Main

Description

Synopsis

Documentation

data D Source #

Constructors

DL 
DR 

main :: IO () Source #

>>> :main
241
Just 116

part1 :: [Coord] -> Int Source #

Given a list of steps determine the ultimate Manhattan-distance from the starting position.

computePath :: [(D, Int)] -> [Coord] Source #

duplicate :: Ord a => [a] -> Maybe a Source #

Find the first duplicate element in a list

toSteps Source #

Arguments

:: Coord

initial direction

-> [(D, Int)]

commands

-> [Coord]

list of directions

Compute steps taken by following a list of commands