diff --git a/Proj2.hs b/Proj2.hs index 143b9fa..be1635b 100644 --- a/Proj2.hs +++ b/Proj2.hs @@ -52,7 +52,7 @@ import Data.List import Data.Set qualified as S import Debug.Trace --- datatypes -- +-- ==== DATA STRUCTURES ======================================================= type GameState = [[Pitch]] @@ -75,10 +75,7 @@ instance Show Octave where instance Show Pitch where show (Pitch note octave) = show note ++ show octave - --- - --- required functions -- +-- ==== REQUIRED FUNCTIONS ==================================================== toPitch :: String -> Maybe Pitch toPitch [note, octave] = Pitch <$> charToNote note <*> charToOctave octave @@ -136,9 +133,8 @@ initialGuess = (chord, chords) nextGuess :: ([Pitch], GameState) -> (Int, Int, Int) -> ([Pitch], GameState) nextGuess (prevGuess, chord : chords) _ = (chord, chords) --- +-- ==== HELPER FUNCTIONS ====================================================== --- helper functions -- allChords :: [[Pitch]] allChords = @@ -170,5 +166,3 @@ matches xs ys = maximum permutationMatches where permutationMatches = map (pairwiseMatches xs) (permutations ys) pairwiseMatches xs ys = length $ filter (uncurry (==)) $ zip xs ys - ---