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

Main

Description

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

Implement a simple submarine piloting/aiming command interpreter.

Synopsis

Documentation

data C Source #

Three possible commands a submarine can recieve.

Constructors

Cforward 
Cdown 
Cup 

main :: IO () Source #

>>> :main
1636725
1872757425

toS :: (C, Int) -> S Source #

Computes the individual effect of a single instruction on a submarine.

data S Source #

Tracks the current state of the submarine's x displacement as well as the displacement for parts 1 and 2

Constructors

S !Int !Int !Int