minor visuals day2
This commit is contained in:
parent
317f01b171
commit
5f2a243e85
|
@ -1,9 +1,8 @@
|
||||||
data Hand = Rock | Paper | Scissor deriving (Eq,Enum,Bounded,Show)
|
data Hand = Rock | Paper | Scissor deriving (Eq,Enum,Bounded,Show)
|
||||||
instance Ord Hand where
|
instance Ord Hand where
|
||||||
compare x y = case fromEnum x - fromEnum y `mod` 3 of
|
compare x y = case (fromEnum x - fromEnum y) `mod` 3 of
|
||||||
0 -> EQ
|
0 -> EQ
|
||||||
1 -> GT
|
1 -> GT
|
||||||
(-2) -> GT
|
|
||||||
_ -> LT
|
_ -> LT
|
||||||
|
|
||||||
(+.) :: Hand -> Int -> Hand
|
(+.) :: Hand -> Int -> Hand
|
||||||
|
|
Loading…
Reference in New Issue
Block a user