projects
/
summerofcode2018soln.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Task 6 done
[summerofcode2018soln.git]
/
src
/
task1
/
task1.hs
diff --git
a/src/task1/task1.hs
b/src/task1/task1.hs
index e7a4f4bacf3770fe7192a9296eaa84dafa58b2a1..b0e263031853ee045dcf3f6cdab8feceed1d4e8a 100644
(file)
--- a/
src/task1/task1.hs
+++ b/
src/task1/task1.hs
@@
-57,7
+57,7
@@
readInstruction i = readInstruction' (head i) (tail i)
readInstruction' _ t = Comment t
readInstruction' _ t = Comment t
-initialMowmaster = Mowmaster
North
(0, 0)
+initialMowmaster = Mowmaster
East
(0, 0)
-- Calculate manhattan distance from start to this state
-- Calculate manhattan distance from start to this state
@@
-75,7
+75,7
@@
execute m (Comment _) = m
-- Move in the current direction
-- Move in the current direction
-forward ::
Int
-> Direction -> Position -> Position
+forward ::
Distance
-> Direction -> Position -> Position
forward s North (e, n) = (e, n+s)
forward s South (e, n) = (e, n-s)
forward s West (e, n) = (e-s, n)
forward s North (e, n) = (e, n+s)
forward s South (e, n) = (e, n-s)
forward s West (e, n) = (e-s, n)