comp30002-project-2/Proj2.hs
2025-09-24 14:52:23 +10:00

36 lines
627 B
Haskell

--
module Proj2
( Pitch,
toPitch,
feedback,
GameState,
initialGuess,
nextGuess,
)
where
type GameState = ()
data Pitch = Pitch
{ note :: Char,
octave :: Int
}
deriving (Eq)
instance Show Pitch where
show (Pitch note octave) = 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 _ _ = ([], [[]])