diff --git a/Proj2.hs b/Proj2.hs index deb4846..67ac910 100644 --- a/Proj2.hs +++ b/Proj2.hs @@ -13,6 +13,8 @@ where import Data.List import Data.Set qualified as S +-- datatypes -- + type GameState = [[Pitch]] data Note = A | B | C | D | E | F | G @@ -35,6 +37,10 @@ instance Show Octave where instance Show Pitch where show (Pitch note octave) = show note ++ show octave +-- + +-- required functions -- + toPitch :: String -> Maybe Pitch toPitch [note, octave] = Pitch <$> charToNote note <*> charToOctave octave where @@ -83,6 +89,14 @@ initialGuess = (chord, chords) where chord : chords = allChords +-- implement me +nextGuess :: ([Pitch], GameState) -> (Int, Int, Int) -> ([Pitch], GameState) +nextGuess (prevGuess, chord : chords) _ = (chord, chords) + +-- + +-- helper functions -- + allChords :: [[Pitch]] allChords = [ chord @@ -108,6 +122,4 @@ allOctaves = [minBound .. maxBound] allNotes :: [Note] allNotes = [minBound .. maxBound] --- implement me -nextGuess :: ([Pitch], GameState) -> (Int, Int, Int) -> ([Pitch], GameState) -nextGuess (prevGuess, chord : chords) _ = (chord, chords) +--