Number Guessing Game - Build a Number Guessing Game

Tell us what’s happening:

Concerning Number Guessing Game: GitHub - OxburnGit/Number-Guessing-Game: freeCodeCamp
Everything seems right, but 2 points are always failed:

  • Welcome back, ! You have played <games_played> games, and your best game took <best_game> guesses

Welcome back, Yoshi! You have played 1 games, and your best game took 9 guesses.

  • You guessed it in <number_of_guesses> tries. The secret number was <secret_number>. Nice job!

You guessed it in 10 tries. The secret number was 194. Nice job!

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36

Challenge Information:

Number Guessing Game - Build a Number Guessing Game

hi and welcome to the forum.

For your code, you seem to have skipped incrementing the guess count here:

  # Check if input is an integer
  if ! [[ $GUESS =~ ^[0-9]+$ ]]
  then
    echo "That is not an integer, guess again:"
    continue
  fi
  

even this type of bad value guess should be counted.