Remove unnecessary helper function for xor
Loosing my edge... slowly... but surely... Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
parent
5f4ffae179
commit
5ca036975b
1 changed files with 1 additions and 5 deletions
|
@ -15,10 +15,6 @@ data Karel = Karel
|
||||||
}
|
}
|
||||||
deriving (Eq)
|
deriving (Eq)
|
||||||
|
|
||||||
xor :: Bool -> Bool -> Bool
|
|
||||||
xor True a = not a
|
|
||||||
xor False a = a
|
|
||||||
|
|
||||||
getHeader :: Karel -> String
|
getHeader :: Karel -> String
|
||||||
getHeader karel = unlines [
|
getHeader karel = unlines [
|
||||||
printf " %8s %s %s %s" "POSITION" "FACING" "BEEP-BAG" "BEEP-POS",
|
printf " %8s %s %s %s" "POSITION" "FACING" "BEEP-BAG" "BEEP-POS",
|
||||||
|
@ -73,7 +69,7 @@ mapWall karel x y = leftPart <> rightPart
|
||||||
| northWall && wallEnds && verticalWall = "-|"
|
| northWall && wallEnds && verticalWall = "-|"
|
||||||
| wallEnds || (northWall && eastWallAbove) = "-+"
|
| wallEnds || (northWall && eastWallAbove) = "-+"
|
||||||
| northWall = "--"
|
| northWall = "--"
|
||||||
| (verticalWall && northWallOnRight) || (eastWall `xor` eastWallAbove) = " +"
|
| (verticalWall && northWallOnRight) || (eastWall /= eastWallAbove) = " +"
|
||||||
| verticalWall = " |"
|
| verticalWall = " |"
|
||||||
| otherwise = " "
|
| otherwise = " "
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue