Tell us what’s happening:
2 of the tests don’t pass even though I’ve done exactly what they’re asking.
I have already tried changing utils.js and package.json.
My table:
Your code so far
#!/bin/bash
PSQL="psql --username=freecodecamp --dbname=number_guess -t --no-align -c"
# get user data from the database
get_user_data() {
local username="$1"
$PSQL "SELECT games_played, best_game FROM users WHERE username='$username';"
}
# update user data in the database
update_user_data() {
local username="$1"
local games_played="$2"
local best_game="$3"
$PSQL "INSERT INTO users (username, games_played, best_game) VALUES ('$username', $games_played, $best_game)
ON CONFLICT (username) DO UPDATE SET games_played = EXCLUDED.games_played, best_game = EXCLUDED.best_game;" > /dev/null
}
# get username input
This file has been truncated. show original
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0
Challenge Information:
Number Guessing Game - Build a Number Guessing Game
I wonder if you have to count the bad (non integer) guesses in your count? (You aren’t counting them right now).
I tried adding +1 to the count if a non integer was read but it still didn’t pass. I don’t think that’s the problem because many other people have complained about those 2 tasks not passing.