Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 559 Bytes

instructions.append.md

File metadata and controls

19 lines (14 loc) · 559 Bytes

Hints

To complete this exercise you need to implement the function score, that takes a sequence of bowling rolls and returns the final score or the appropriate error:

score :: [Int] -> Either BowlingError Int

data BowlingError = IncompleteGame
                  | InvalidRoll { rollIndex :: Int, rollValue :: Int }
                  deriving (Eq, Show)

You will find these definitions already in place, but it is up to you to define the function.

Keep in mind that the test suite expects the rolls to be numbered starting from zero.