Merge branch 'main' of gitea.adbraun.lol:adam/wordle
Deploy game to server / deploy (push) Successful in 7s
Deploy game to server / deploy (push) Successful in 7s
This commit is contained in:
commit
9bf92b856a
1 file changed
+5
-1
@@ -33,6 +33,7 @@ function main() {
|
|||||||
declare -g ANSWER
|
declare -g ANSWER
|
||||||
declare -g POOL='QWERTYUIOPASDFGHJKLZXCVBNM'
|
declare -g POOL='QWERTYUIOPASDFGHJKLZXCVBNM'
|
||||||
declare -Ag YELLOWS
|
declare -Ag YELLOWS
|
||||||
|
declare -g REVEALING=0
|
||||||
ANSWER=$(select_random_word)
|
ANSWER=$(select_random_word)
|
||||||
|
|
||||||
set_options "$@"
|
set_options "$@"
|
||||||
@@ -61,6 +62,7 @@ function main() {
|
|||||||
check_guess "${GUESS}" "${ROW}" ; WIN=$?
|
check_guess "${GUESS}" "${ROW}" ; WIN=$?
|
||||||
|
|
||||||
reveal_row "${ROW}"
|
reveal_row "${ROW}"
|
||||||
|
REVEALING=0
|
||||||
|
|
||||||
if [[ $WIN == 5 ]]; then
|
if [[ $WIN == 5 ]]; then
|
||||||
save_result
|
save_result
|
||||||
@@ -88,6 +90,7 @@ function main() {
|
|||||||
echo "Share/view your stats with -> curl \"${URL_BASE}/stats/${USER}\""
|
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}"
|
while read -r board_line; do echo "${board_line//[A-Z]/ }"; done < "${RESULT_FILE}"
|
||||||
fi
|
fi
|
||||||
|
echo -en "${RESET}"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -350,6 +353,7 @@ function check_guess() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function reveal_row() {
|
function reveal_row() {
|
||||||
|
REVEALING=1
|
||||||
echo -en "${UP1}${SAVE}"
|
echo -en "${UP1}${SAVE}"
|
||||||
echo -en "${HIDE_CURSOR}"
|
echo -en "${HIDE_CURSOR}"
|
||||||
# Must increment by 1 Row as 0 == 1 for escape code
|
# Must increment by 1 Row as 0 == 1 for escape code
|
||||||
@@ -382,7 +386,7 @@ function save_game() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
{
|
{
|
||||||
echo "ROW=${ROW}"
|
echo "ROW=$(( ROW + REVEALING ))"
|
||||||
echo "POOL=${POOL}"
|
echo "POOL=${POOL}"
|
||||||
echo "HARD_MODE=${HARD_MODE}"
|
echo "HARD_MODE=${HARD_MODE}"
|
||||||
echo "STRICT_HARD_MODE=${STRICT_HARD_MODE}"
|
echo "STRICT_HARD_MODE=${STRICT_HARD_MODE}"
|
||||||
|
|||||||
Reference in new issue
Block a user