From 2eca62528a89df737ca6194edb955f7bbaf11a56 Mon Sep 17 00:00:00 2001 From: Andrew Maier Date: Thu, 9 Dec 2021 15:54:44 +0100 Subject: [PATCH] added day03 --- day03/CHANGELOG.md | 5 + day03/app/Main.hs | 9 + day03/data/input.txt | 1000 ++++++++++++++++++++++++++++++++++++++++++ day03/day03.cabal | 42 ++ day03/lib/Day03.hs | 7 + 5 files changed, 1063 insertions(+) create mode 100644 day03/CHANGELOG.md create mode 100644 day03/app/Main.hs create mode 100644 day03/data/input.txt create mode 100644 day03/day03.cabal create mode 100644 day03/lib/Day03.hs diff --git a/day03/CHANGELOG.md b/day03/CHANGELOG.md new file mode 100644 index 0000000..7db9a26 --- /dev/null +++ b/day03/CHANGELOG.md @@ -0,0 +1,5 @@ +# Revision history for day03 + +## 0.1.0.0 -- YYYY-mm-dd + +* First version. Released on an unsuspecting world. diff --git a/day03/app/Main.hs b/day03/app/Main.hs new file mode 100644 index 0000000..31ecb8f --- /dev/null +++ b/day03/app/Main.hs @@ -0,0 +1,9 @@ +module Main where + +import Day03 (day03Part1, day03Part2) + +main :: IO () +main = do + input <- readFile "./data/input.txt" + putStrLn $ "Part 1: " <> day03Part1 input + putStrLn $ "Part 2: " <> day03Part2 input diff --git a/day03/data/input.txt b/day03/data/input.txt new file mode 100644 index 0000000..52865a8 --- /dev/null +++ b/day03/data/input.txt @@ -0,0 +1,1000 @@ +000011001000 +001111100100 +110101011111 +010100001101 +110001001000 +010000110100 +010011010010 +110101000011 +100111001001 +001101110011 +001101011010 +000010111000 +111001101010 +001010011011 +000101101100 +010011011101 +111100101001 +110110100011 +001100000110 +111010110110 +110110011100 +110000011111 +010101111110 +011001111010 +110101100111 +101111010011 +001111000011 +001110011100 +000011001001 +100101101100 +010110000101 +000001110001 +000100011101 +011110001101 +000111000110 +000111011001 +110111110100 +101110010000 +111010000000 +000111001001 +010101010001 +111100100000 +100000000101 +100111010111 +000111110110 +000000101010 +010010001011 +000100100000 +111101011100 +001100110000 +001101010100 +001011100101 +010011000101 +000001000101 +010101110110 +101110101101 +011011110011 +110101111101 +110101011000 +001001110100 +001001110111 +110100100100 +110110110111 +111001001100 +010101101010 +010101110010 +110100011101 +011111100110 +001011010011 +010100010100 +010111101000 +111000000101 +110101110101 +111010111111 +101000110011 +011111000011 +001011010100 +000001101001 +011110010010 +000001100111 +111010110010 +000111100110 +010001000101 +101010100001 +110011000101 +010101010110 +111110111000 +000100110001 +100011100111 +000110011010 +001110100111 +110001111000 +101000010111 +110000010011 +111101111011 +010001011010 +011110000111 +010011101100 +011101010010 +100111110011 +100010100010 +010000011100 +001111010011 +111000111111 +000100111100 +001100101110 +001000011110 +001101101000 +100101000011 +011001010011 +111001100101 +111110011111 +011010111010 +001100101101 +111100110011 +111001000100 +100111111101 +101101101111 +110011100111 +010000111101 +001100111101 +011110101000 +001110010001 +011010001110 +110110110010 +001010111101 +110110011110 +011110111111 +001000011010 +001011000010 +110011111001 +010110110000 +101011111111 +110100111001 +100110000011 +101010011100 +011100011100 +101011001011 +001010100011 +001110100011 +000100000001 +111011101000 +000010011111 +010101101110 +001101010110 +110100101101 +101101010001 +100110010111 +100101010010 +011000101101 +010001100000 +110100110010 +001011101001 +110100111000 +111000111000 +100011001001 +011010100110 +001110011110 +101011110001 +000100101010 +001111101001 +111011101010 +001001010000 +111000011000 +001110100110 +001111011100 +000000111111 +000100110111 +010010111101 +100011000110 +001110011011 +001011011000 +000100101110 +100001010100 +110101010111 +110110101011 +111110011100 +100001111101 +001001001010 +100101111001 +101111010101 +100110110000 +101110010110 +101000000111 +100000110001 +001111110100 +011111010101 +010100110111 +010110101110 +100001010010 +101011100110 +100001001010 +001110101000 +100010110010 +100101100011 +111000000010 +101110110110 +011110001011 +101101111000 +001111001000 +010111000101 +111111111100 +000000011010 +001000010110 +111110000110 +110001110010 +101110001000 +010100011110 +111110001001 +010111111100 +111100100001 +001000010101 +010000001011 +011000101000 +001000010011 +111100000111 +100110101010 +011001011111 +101110100111 +111011100010 +010111110100 +010111110110 +111010101001 +100110100111 +100000001000 +111001110100 +000010101011 +101000001111 +001000011111 +000010010000 +110010000001 +111110111010 +111100101010 +101000100111 +110101011110 +000010001010 +100101111000 +011001000011 +101001000011 +010101001000 +111111101000 +101001001101 +010101000101 +010010011100 +011011011100 +100010001111 +100000000100 +101111101001 +011110001110 +010110011000 +111110110101 +010101000010 +001100110011 +111110100001 +110110111100 +110101011101 +100010111111 +101111000111 +001100011000 +011001001110 +101110111111 +010110111100 +111000001100 +000001111110 +101001011010 +000001101100 +110111111110 +101010000101 +010101001100 +011101111001 +110101100001 +111000010110 +100001101101 +000000011110 +011101001011 +011111111000 +011001001100 +010011001100 +001111010000 +111111000001 +010000010000 +010000101001 +111001110111 +100100000101 +100011010011 +110111100010 +111100110001 +000000111000 +000101101101 +101110001010 +011101111100 +110000100101 +010010111001 +011011010111 +011111101001 +010001100001 +110011100011 +111010110011 +011000101001 +000011101001 +001000110111 +011010010001 +101111111111 +110011110101 +000000100000 +101111110010 +011100010001 +000001100001 +000010000001 +110110000100 +011011001101 +101001011111 +000111100101 +110101111010 +100101100100 +100001110111 +101110001001 +110110010110 +111000000011 +001101110010 +010000001000 +101001010101 +000101111000 +110011101110 +010010001000 +110010010000 +011001110111 +000010110000 +000110100101 +000101101001 +000110101110 +011101100001 +100111110010 +010100111001 +110111111100 +110110000001 +001011000100 +101010101010 +011100000001 +100001001000 +010110110110 +011000100001 +100001001100 +010000110000 +111111101100 +000101101110 +111010101010 +101001111100 +010011100001 +001011001001 +100111110110 +010111001000 +101110000101 +110110001110 +010000000101 +110010010110 +011100100011 +001111101000 +111111011001 +010100100010 +001111000110 +001110000110 +110101010001 +001100011100 +010001101101 +011110010100 +110000101101 +011110011110 +110101001100 +101011101000 +101000001100 +101000000010 +011010100100 +110000000101 +000010001001 +111010010110 +000110110010 +101000111001 +101001011000 +010111011111 +000110111101 +000100011001 +010101110100 +101010010111 +001010100111 +111010101101 +101011011101 +010011101110 +000111111000 +111000111011 +011101110100 +100100111110 +011100000101 +100011111010 +010010010000 +001011101111 +110011001011 +100011111100 +000010011101 +110010000000 +001011010110 +010110111110 +101011010101 +011111111111 +001011001011 +010101011001 +110011110100 +111001001111 +111001110110 +001000000111 +111011111110 +100100100111 +110001110101 +011001111110 +001101000100 +101011000100 +110111101000 +100100001100 +011001011010 +001000010001 +011001111011 +111010011000 +111001001110 +111100010000 +111101100001 +001000111110 +011111001100 +101001111001 +010010000110 +001010000011 +100011100000 +111101110110 +100111010001 +111000011111 +100100010110 +010100000101 +101110001011 +101100100011 +010000101010 +110110101001 +010110100101 +100000110111 +010010000010 +101000010001 +110001111101 +011001011100 +011111100011 +010100100000 +001110011101 +100011010001 +000111010101 +001111000100 +001111101011 +001001011101 +110110101100 +011101111010 +011110001000 +000111001100 +010100111000 +100100110000 +110100001111 +010010010110 +110111101011 +111011011001 +011001101010 +011011001010 +111001101100 +000011110001 +111111001011 +110111100110 +110111110011 +101010111011 +111010110111 +000100000010 +110011011110 +101010111101 +000110111000 +111011011111 +010001110110 +000011000100 +100001010101 +000111001101 +111011000011 +001110110000 +110101111011 +011011010100 +001100100000 +100011101001 +010101100110 +001101000000 +011110100001 +000110110011 +000000000100 +110110111010 +000100001101 +110101111000 +010100101011 +000011011011 +011011100001 +011011001100 +000101111100 +101010011110 +011111100000 +100011000101 +010111101110 +100000110101 +001101111100 +010111100010 +011000000001 +101001101111 +001011000001 +111000110101 +000000110100 +100001110001 +001000101100 +001011101100 +110010101000 +010011001011 +001111011000 +110001100100 +110010100001 +100101010100 +010000101100 +111010101111 +000010000100 +000101000010 +110000101110 +010001000110 +110001011100 +101000111101 +111011111100 +011100101111 +010111100111 +110111011001 +010100000000 +010100101101 +101010111001 +001010100001 +011010010011 +111011100101 +010110110101 +110010101100 +000101010111 +100010001110 +100111101100 +001000100001 +110111110001 +101100011100 +100101101001 +110010101111 +000010001100 +011111110010 +011111011011 +110101010010 +001110101100 +101111101100 +101001101001 +011010101010 +111110100111 +000110001111 +100110110100 +111011100100 +100100101001 +000011101100 +100001000011 +101100001011 +000101011011 +110001010000 +111111011110 +000100110100 +011110110010 +101111100111 +010010110100 +001001000001 +111101101111 +000010010001 +001011001100 +110110010000 +101000100110 +111100001010 +011010101101 +011101101110 +010101000110 +100110011110 +011001000100 +101111111010 +011001101000 +001010100100 +000101111101 +111010110001 +001100111110 +100000100000 +101011101011 +011101011110 +110011111101 +001111000111 +101110111011 +001110111011 +001010100101 +111011110111 +011011000100 +111000001101 +111110011101 +101001001000 +111110001011 +100000000110 +011100010101 +000111101001 +110101001000 +011000000011 +100000001001 +111010000100 +111110010111 +110000010001 +100001000110 +000100000000 +101000100010 +011011010011 +001000111000 +001101101010 +000010010100 +100101111100 +101110110101 +101110100010 +010100000010 +011110001001 +111111010011 +111111101001 +001010000001 +100100111000 +000011001011 +010111000010 +000000001101 +010100011111 +101001010100 +001110111111 +111110111100 +010010101011 +100010000001 +101001111010 +111101000010 +100100011101 +011111010001 +111111011000 +110101010110 +110101011011 +010011110000 +010000011001 +011000111101 +101011011000 +110111101101 +101010000000 +101100100010 +111001010111 +100101010111 +011101101011 +011000011010 +111010011101 +000100011000 +110111100011 +001100010111 +000111100100 +011010000000 +101010000001 +010100011100 +110001111001 +011111010111 +101111110011 +101100001000 +111011101001 +010011001101 +100001111110 +000111011101 +011110100010 +010110010010 +001110101001 +001000100000 +000110111110 +111110011010 +111100100100 +010100110000 +001101100100 +100010111010 +010000101111 +100001011000 +010100101100 +101010011001 +100111111000 +001100001011 +111111010000 +100001111000 +110010000111 +000000110101 +000101000100 +100000101011 +101100010100 +100111101000 +100111100001 +100001100111 +110001110000 +001010100010 +110000011010 +111010111000 +111100111001 +011011001111 +101011110111 +001001010100 +111110010011 +111000110100 +100111110101 +001001001110 +111000101111 +011001110100 +011100000110 +000111010010 +000111000010 +111000111010 +111100001110 +000011111100 +000111100001 +110111001111 +011111000100 +101001000001 +010001101111 +001101001010 +001100001100 +000111001010 +011010011101 +000111111100 +001011111110 +101100101111 +100010110001 +101100001110 +111000011001 +010010000011 +110000000000 +111111011100 +100011101010 +101000000110 +111111101101 +001010101101 +100101110011 +001010111111 +101001101000 +100100000110 +011011000011 +000010110110 +110110011111 +100011100001 +010011111100 +011001101011 +111001110001 +111100111000 +101010011111 +010101111011 +000001000100 +110010111101 +110101010101 +100100100010 +011000010000 +111101011000 +111111110101 +111010100011 +000100100010 +001110110101 +100001100110 +001011000000 +001110010101 +010101100111 +111101100111 +000011110111 +101000010101 +000000101011 +100101000111 +110011001000 +111101101101 +111100001101 +010101010100 +011111001111 +011010011011 +001100011110 +001111110101 +010001010010 +011010100000 +100110100010 +110110110001 +100101000101 +011101101100 +111000100001 +101011011010 +101001100111 +100000110110 +101101011101 +011000101110 +000011011100 +001010010101 +010001010110 +010100000100 +001101100011 +011110110000 +101101100110 +101011110000 +111100111010 +001101111010 +011011011101 +011111000111 +001011000110 +001110010110 +110100101001 +111010010010 +011100101000 +110100110011 +111011111101 +011011001011 +011101101001 +000101110110 +111010101100 +100100011001 +111011101110 +010001101110 +010101011011 +111010000110 +111111111001 +011011001000 +110000110011 +100010101001 +010101100011 +010011111010 +101111011101 +100110000111 +110100100101 +001000001100 +001101100110 +110110101111 +111001011100 +110110001001 +010111110011 +010000001010 +000101100110 +001011101101 +001010110001 +111100011111 +110110100100 +001001111011 +010100010011 +000100010011 +010011010100 +100011000100 +001000101111 +000011010001 +111111001101 +101011010001 +011101100100 +101110110100 +100101100101 +111000110010 +010000010011 +011011000010 +011010011110 +001000110101 +011011101010 +001101010101 +001110110010 +111100111100 +011011100111 +011101001101 +010011011001 +110100100000 +110011010111 +010111001100 +101110101011 +111001001010 +010011101011 +100000001010 +000010101010 +001110101011 +000100111001 +010011111011 +110001001110 +111111001100 +011010100101 +101001100010 +100110000010 +010001001000 +111111010001 +000110011110 +001011011110 +000111101100 +000001110000 +111011011010 +110001001010 +011110011001 +001110100010 +001101110110 +100011011010 +101000111010 +010010101101 +011100111000 +011001100001 +011100110110 +111101011001 +100100010000 +101000001001 +000000101110 +001001000000 +111110011000 +101110100101 +110010001100 +110010001001 +101110100110 +100101000100 +001010110110 +000001011110 +001001011111 +011000001001 +101001100001 +100011011100 +010000111111 +001001010101 +110011010011 +010110111011 +000010101001 +110101101101 +110101000111 +111110010010 +001110111101 +100011110101 +111000101011 +110011101000 +111111001000 +010010111110 +111001111001 +100101111111 +010011011000 +100010010011 +111110111001 +100000011011 +000110000100 +101001001100 +110101110010 +010101101111 +101010011010 +110110110000 +101100110100 +110111010001 +011011101111 +000111110111 +011000101010 +001011110001 +001010010001 +110100110110 +000101010101 +101100101011 +001010000110 +111101010111 +011011111000 +011010010010 +110010001110 +001111100101 +101101001111 +011110110110 +011011011011 +101001100100 +111001000000 +010001101011 +010011110101 +101011000011 +100010100111 +100110111010 +000010110101 +111101010101 +100100000100 +101111111011 +010101000111 +000110001101 +001101101110 +011011011010 +010100100001 +101101110001 +010010100001 +011100100101 +001110000011 +010011011110 +000100100011 +110101100000 +111011010110 +110100111111 +000101110101 +110000000011 +010110101101 +100001011110 +110110101101 +001101000010 +101110101000 +010100101000 +110001000010 +111111000010 +001000111101 +001111111001 +010100010000 diff --git a/day03/day03.cabal b/day03/day03.cabal new file mode 100644 index 0000000..a53aa14 --- /dev/null +++ b/day03/day03.cabal @@ -0,0 +1,42 @@ +cabal-version: 2.4 +name: day03 +version: 0.1.0.0 + +-- A short (one-line) description of the package. +-- synopsis: + +-- A longer description of the package. +-- description: + +-- A URL where users can report bugs. +-- bug-reports: + +-- The license under which the package is released. +-- license: +author: Andrew Maier +maintainer: andrew@maier.name + +-- A copyright notice. +-- copyright: +-- category: +extra-source-files: CHANGELOG.md + +executable day03 + main-is: Main.hs + + -- Modules included in this executable, other than Main. + -- other-modules: + + -- LANGUAGE extensions used by modules in this package. + -- other-extensions: + build-depends: base ^>=4.14.3.0 + , day03 + hs-source-dirs: app + default-language: Haskell2010 + +library + build-depends: base ^>=4.14.3.0 + hs-source-dirs: lib + exposed-modules: Day03 + default-language: Haskell2010 + diff --git a/day03/lib/Day03.hs b/day03/lib/Day03.hs new file mode 100644 index 0000000..867960a --- /dev/null +++ b/day03/lib/Day03.hs @@ -0,0 +1,7 @@ +module Day03 where + +day03Part1 :: String -> String +day03Part1 _ ="Day03 Part1" + +day03Part2 :: String -> String +day03Part2 _ ="Day03 Part2"