From ede394ac3959cc2f282567a7fb56fa6e332ae987 Mon Sep 17 00:00:00 2001 From: wi11-holdsworth <83637728+wi11-holdsworth@users.noreply.github.com> Date: Thu, 2 Oct 2025 11:33:38 +1000 Subject: [PATCH] feat: use a "vibes-based" best first guess, to be replaced with a more optimal guess later --- Proj2.hs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Proj2.hs b/Proj2.hs index 6d4c01c..d4b01f8 100644 --- a/Proj2.hs +++ b/Proj2.hs @@ -148,12 +148,22 @@ feedback target guess = (pitches, notes, octaves) notes = matches (map note targetNoPitches) (map note guessNoPitches) octaves = matches (map octave targetNoPitches) (map octave guessNoPitches) --- TODO: comment me +-- outputs a 2-tuple of the "best first guess" and the initial game state, +-- which is all possible starting guesses. characteristics of these guesses +-- are described in the documentation for `allChords` +-- +-- currently, the best first guess is "vibes based". there is a TODO to +-- actually evaluate the best guess properly. -- initialGuess :: ([Pitch], GameState) -initialGuess = (chord, chords) +initialGuess = (bestFirstGuess, allChords) where - chord : chords = allChords + -- TODO: is this really the best first guess? + bestFirstGuess = + [ Pitch A One, + Pitch B Two, + Pitch C Three + ] -- takes in the previous guess, the game state, and the feedback for the -- previous guess and outputs the next guess and a (reduced in size) game state