build: initial commit

This commit is contained in:
Will 2025-09-24 11:47:58 +10:00 committed by wi11-holdsworth
commit 6ece1fe6bc
4 changed files with 472 additions and 0 deletions

29
Proj2.hs Normal file
View file

@ -0,0 +1,29 @@
--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], ())