keep hard mode hints when resuming a game

hard_mode_check uses the previous row's greens and yellows, but these
weren't written to the progress file, so after resuming a game the next
guess could drop known green and yellow letters. Save them alongside
the rest of the game state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
adamandClaude Opus 5.5 committed 2026-09-29 17:19:24 +00:00
1 parent 73f403693a
commit f29d81e932
1 file changed
+9
+9
View File
@@ -409,6 +409,15 @@ function save_game() {
echo "KEYS[$key]='${KEYS[$key]}'" >> "${PROGRESS_FILE}" echo "KEYS[$key]='${KEYS[$key]}'" >> "${PROGRESS_FILE}"
done done
# Previous row's hints, needed by hard_mode_check after a resume
for key in "${!greens[@]}"; do
echo "greens[$key]='${greens[$key]}'" >> "${PROGRESS_FILE}"
done
for key in "${!yellows[@]}"; do
echo "yellows[$key]='${yellows[$key]}'" >> "${PROGRESS_FILE}"
done
{ {
echo "ROW=${row}" echo "ROW=${row}"
echo "POOL=${POOL}" echo "POOL=${POOL}"