Safe HaskellNone

Day02

Description

General - Main problem was parsing the input file :).

Part 1 - After you have the data, solving the puzzle becomes easy.

Part 2 - Implemented xor for that.

Synopsis

Documentation

data Password #

The policy and the password to check.

Constructors

Password 

Fields

  • Int

    Minimal number of occurences for character.

  • Int

    Maximum number of occurences for character.

  • Char

    The character.

  • String

    The password.

Instances

Instances details
Eq Password # 
Instance details

Defined in Day02

Methods

(==) :: Password -> Password -> Bool

(/=) :: Password -> Password -> Bool

Show Password # 
Instance details

Defined in Day02

Methods

showsPrec :: Int -> Password -> ShowS

show :: Password -> String

showList :: [Password] -> ShowS

input :: String -> [Password] #

Read the input file.

xor :: Bool -> Bool -> Bool #

XOR the expression.

part1 :: [Password] -> Int #

Solve part1.

part2 :: [Password] -> Int #

Solve part2.