Day2 use enum for shapes
This commit is contained in:
@@ -5,13 +5,20 @@ import Day2.Shared
|
||||
import Day2.Part1
|
||||
import Day2.Part2
|
||||
|
||||
input :: String
|
||||
input :: String
|
||||
input = "A Y\nB X\nC Z"
|
||||
|
||||
spec :: Spec
|
||||
spec =
|
||||
describe "Day2" $ do
|
||||
describe "Day2 - Shared" $ do
|
||||
it "should implement winAgainst and loseAgainst for shapes" $ do
|
||||
winAgainst Rock `shouldBe` Paper
|
||||
winAgainst Paper `shouldBe` Scissors
|
||||
winAgainst Scissors `shouldBe` Rock
|
||||
loseAgainst Rock `shouldBe` Scissors
|
||||
loseAgainst Paper `shouldBe` Rock
|
||||
loseAgainst Scissors `shouldBe` Paper
|
||||
it "should have scores for shapes" $ do
|
||||
shapeScore Rock `shouldBe` Score 1
|
||||
shapeScore Paper `shouldBe` Score 2
|
||||
|
||||
Reference in New Issue
Block a user