fixed only first letter being displayed on a win where it was wrong before

This commit is contained in:
adam committed 2025-01-29 01:48:38 +00:00
1 parent f37c483518
commit 9378e5e585
1 file changed
+3 -3
+3 -3
View File
@@ -179,7 +179,7 @@ function validate_guess() {
} }
function hard_mode_check() { function hard_mode_check() {
#[[ -z "${row}" || "${row}" == 0 ]] && return 0 [[ -z "${row}" || "${row}" == 0 ]] && return 0
declare GUESS=$1 declare GUESS=$1
@@ -235,8 +235,6 @@ function check_guess() {
continue continue
fi fi
[[ "${#greens[*]}" -eq 5 ]] && return 5
if [[ "${chars}" == *${_char}* ]]; then if [[ "${chars}" == *${_char}* ]]; then
chars="${chars/${_char}/}" chars="${chars/${_char}/}"
yellows[c]="${_char}" yellows[c]="${_char}"
@@ -247,6 +245,8 @@ function check_guess() {
[[ " ${greens[*]} " =~ ${_char} ]] && continue [[ " ${greens[*]} " =~ ${_char} ]] && continue
POOL="${POOL/${_char}/_}" POOL="${POOL/${_char}/_}"
done done
[[ "${#greens[*]}" == 5 ]] && return 5
} }
function reveal_row() { function reveal_row() {