47 lines
842 B
Haskell
47 lines
842 B
Haskell
--
|
|
|
|
module Proj2
|
|
( Pitch,
|
|
toPitch,
|
|
feedback,
|
|
GameState,
|
|
initialGuess,
|
|
nextGuess,
|
|
)
|
|
where
|
|
|
|
type GameState = ()
|
|
|
|
data Note = A | B | C | D | E | F | G
|
|
deriving (Eq, Show, Ord)
|
|
|
|
data Octave = One | Two | Three
|
|
deriving (Eq, Ord)
|
|
|
|
data Pitch = Pitch
|
|
{ note :: Note,
|
|
octave :: Octave
|
|
}
|
|
deriving (Eq, Ord)
|
|
|
|
instance Show Octave where
|
|
show One = "1"
|
|
show Two = "2"
|
|
show Three = "3"
|
|
|
|
instance Show Pitch where
|
|
show (Pitch note octave) = show note ++ show octave
|
|
|
|
toPitch :: String -> Maybe Pitch
|
|
toPitch _ = Just (Pitch 'A' 1)
|
|
|
|
feedback :: [Pitch] -> [Pitch] -> (Int, Int, Int)
|
|
feedback _ _ = (0, 0, 0)
|
|
|
|
-- implement me
|
|
initialGuess :: ([Pitch], GameState)
|
|
initialGuess = ([], [[]])
|
|
|
|
-- implement me
|
|
nextGuess :: ([Pitch], GameState) -> (Int, Int, Int) -> ([Pitch], GameState)
|
|
nextGuess _ _ = ([], [[]])
|