projects
/
advent-of-code-16.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated README to fix a typo and add some clarificaiton about directories
[advent-of-code-16.git]
/
adventofcode16
/
app
/
advent23.hs
diff --git
a/adventofcode16/app/advent23.hs
b/adventofcode16/app/advent23.hs
index dfb98cdab1e70e4c81fb3e360fa4fbb7a875e2f8..2903967e8b37f64624dd7cc3eea301717050bc0d 100644
(file)
--- a/
adventofcode16/app/advent23.hs
+++ b/
adventofcode16/app/advent23.hs
@@
-21,7
+21,6
@@
data Machine = Machine { a :: Int
, instructions :: [Instruction]}
deriving (Show, Eq)
, instructions :: [Instruction]}
deriving (Show, Eq)
-
testInstructions = "cpy 2 a\n\
\tgl a\n\
\tgl a\n\
testInstructions = "cpy 2 a\n\
\tgl a\n\
\tgl a\n\
@@
-30,7
+29,6
@@
testInstructions = "cpy 2 a\n\
\dec a\n\
\dec a"
\dec a\n\
\dec a"
-
emptyMachine :: Machine
emptyMachine = Machine {a=0, b=0, c=0, d=0, pc=0, instructions=[]}
emptyMachine :: Machine
emptyMachine = Machine {a=0, b=0, c=0, d=0, pc=0, instructions=[]}
@@
-179,4
+177,4
@@
parseIline input = parse instructionLine "(unknown)" input
successfulParse :: Either ParseError [a] -> [a]
successfulParse (Left _) = []
successfulParse :: Either ParseError [a] -> [a]
successfulParse (Left _) = []
-successfulParse (Right a) = a
\ No newline at end of file
+successfulParse (Right a) = a