comp30002-project-2/Proj2.hs
2025-09-24 12:19:57 +10:00

29 lines
840 B
Haskell

--Implement your solution here
--SEE THE PROJECT CODING GUIDELINES ON THE LMS FOR DETAILS OF
--THE CRITERIA THAT WILL BE EMPLOYED IN ASSESSING YOUR CODE.
--Please DELETE THIS WHOLE COMMENT, and write your own.
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)
initialGuess :: ([Pitch], GameState)
initialGuess = ([Pitch 'A' 1], ())
nextGuess :: ([Pitch], GameState) -> (Int, Int, Int) -> ([Pitch], GameState)
nextGuess _ _ = ([Pitch 'A' 1], ())