Compare commits

4 Commits
Author SHA1 Message Date
adam 9bf92b856a Merge branch 'main' of gitea.adbraun.lol:adam/wordle
Deploy game to server / deploy (push) Successful in 7s
2025-08-28 10:00:19 +00:00
adam 22b1c374f6 add reset before exit
Deploy game to server / deploy (push) Successful in 6s
2025-05-04 12:46:24 +01:00
adam 6848ac6575 Merge pull request 'resume on correct row after save during row reveal' (#10) from bugfix/issue-9 into main
Deploy game to server / deploy (push) Successful in 7s
Reviewed-on: #10
2025-05-04 11:36:06 +00:00
adam 39265c3c9d resume on correct row after save during row reveal 2025-05-04 12:33:56 +01:00
+5 -1
View File
@@ -33,6 +33,7 @@ function main() {
declare -g ANSWER
declare -g POOL='QWERTYUIOPASDFGHJKLZXCVBNM'
declare -Ag YELLOWS
declare -g REVEALING=0
ANSWER=$(select_random_word)
set_options "$@"
@@ -61,6 +62,7 @@ function main() {
check_guess "${GUESS}" "${ROW}" ; WIN=$?
reveal_row "${ROW}"
REVEALING=0
if [[ $WIN == 5 ]]; then
save_result
@@ -88,6 +90,7 @@ function main() {
echo "Share/view your stats with -> curl \"${URL_BASE}/stats/${USER}\""
while read -r board_line; do echo "${board_line//[A-Z]/ }"; done < "${RESULT_FILE}"
fi
echo -en "${RESET}"
exit 0
}
@@ -350,6 +353,7 @@ function check_guess() {
}
function reveal_row() {
REVEALING=1
echo -en "${UP1}${SAVE}"
echo -en "${HIDE_CURSOR}"
# Must increment by 1 Row as 0 == 1 for escape code
@@ -382,7 +386,7 @@ function save_game() {
done
{
echo "ROW=${ROW}"
echo "ROW=$(( ROW + REVEALING ))"
echo "POOL=${POOL}"
echo "HARD_MODE=${HARD_MODE}"
echo "STRICT_HARD_MODE=${STRICT_HARD_MODE}"