X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=src%2Ftask1%2Ftask1.hs;h=b0e263031853ee045dcf3f6cdab8feceed1d4e8a;hb=56de4596adb43e9505c41fdd734954099d2f8a99;hp=e7a4f4bacf3770fe7192a9296eaa84dafa58b2a1;hpb=0ada5a1833d263689d2f29eabf203a1eb163f84d;p=summerofcode2018soln.git diff --git a/src/task1/task1.hs b/src/task1/task1.hs index e7a4f4b..b0e2630 100644 --- 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 -initialMowmaster = Mowmaster North (0, 0) +initialMowmaster = Mowmaster East (0, 0) -- Calculate manhattan distance from start to this state @@ -75,7 +75,7 @@ execute m (Comment _) = m -- 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)