From f7a6219e119fedd3abd3d6967f1c6d104b04d8e4 Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Sun, 4 Dec 2016 19:58:11 +0000 Subject: [PATCH] Various tidying bits --- README.html | 22 +++++++++++++++++++--- README.md | 16 ++++++++-------- advent-of-code-16.sublime-project | 8 ++++++++ advent01.hs | 2 ++ advent02.hs | 2 ++ advent03.hs | 2 ++ advent04.hs | 2 ++ 7 files changed, 43 insertions(+), 11 deletions(-) create mode 100644 advent-of-code-16.sublime-project diff --git a/README.html b/README.html index 0877da1..68668e7 100644 --- a/README.html +++ b/README.html @@ -1,12 +1,28 @@ -

-

Advent of Code 2016

+ + + + + + + Advent of Code 2016 + + + + +

Code to solve the Advent of Code puzzles. This year, I'm trying to use the puzzles as a prompt to learn Haskell.

Learn you a Haskell, Introduction to Haskell 98, and Hackage are good resources.

I'm using the basic Haskell Platform installation (install with

$ sudo aptitude install haskell-platform

).

Compile the code with

-
ghc -o advent01 advent01.hs
+
ghc --make advent01.hs

then run it as

advent01
+

Build this readme file wth

+
pandoc -s README.md > README.html

(Using the Modest styles.)

+ + diff --git a/README.md b/README.md index fe9e6b5..d95ac12 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,8 @@ --- title: "Advent of Code 2016" -output: - html_document: - css: modest.css +output: html_document +css: modest.css --- - - -# Advent of Code 2016 - Code to solve the [Advent of Code](http://adventofcode.com/2016/) puzzles. This year, I'm trying to use the puzzles as a prompt to learn [Haskell](https://wiki.haskell.org/Haskell). [Learn you a Haskell](http://learnyouahaskell.com/chapters), [Introduction to Haskell 98](https://www.haskell.org/tutorial/index.html), and [Hackage](https://hackage.haskell.org/) are good resources. @@ -20,7 +15,7 @@ $ sudo aptitude install haskell-platform Compile the code with ``` -ghc -o advent01 advent01.hs +ghc --make advent01.hs ``` then run it as @@ -28,4 +23,9 @@ then run it as advent01 ``` +Build this readme file wth +``` +pandoc -s README.md > README.html +``` + (Using the [Modest styles](https://github.com/markdowncss/modest).) \ No newline at end of file diff --git a/advent-of-code-16.sublime-project b/advent-of-code-16.sublime-project new file mode 100644 index 0000000..24db303 --- /dev/null +++ b/advent-of-code-16.sublime-project @@ -0,0 +1,8 @@ +{ + "folders": + [ + { + "path": "." + } + ] +} diff --git a/advent01.hs b/advent01.hs index 6b3eefd..a896944 100644 --- a/advent01.hs +++ b/advent01.hs @@ -1,3 +1,5 @@ +module Main(main) where + import Data.List (sort) import Data.List.Split (splitOn) diff --git a/advent02.hs b/advent02.hs index 3ea1559..d4abc55 100644 --- a/advent02.hs +++ b/advent02.hs @@ -1,3 +1,5 @@ +module Main(main) where + import Data.Array.IArray -- Row 1 is top, column 1 is left diff --git a/advent03.hs b/advent03.hs index d086908..e97dd66 100644 --- a/advent03.hs +++ b/advent03.hs @@ -1,3 +1,5 @@ +module Main(main) where + import Data.List (transpose, sort) import Data.List.Split (splitOn, chunksOf) diff --git a/advent04.hs b/advent04.hs index fb2839e..e48c257 100644 --- a/advent04.hs +++ b/advent04.hs @@ -1,3 +1,5 @@ +module Main(main) where + import Data.List (last, intersperse, sortBy, intercalate, isInfixOf) import Data.List.Split (splitOn) import Data.Char (isLetter, ord, chr) -- 2.34.1