https://github.com/fernandesotero/fcc-number-guess
Solution for Number Guess challenge at @freeCodeCamp
https://github.com/fernandesotero/fcc-number-guess
bash-script dbms git postgresql
Last synced: 2 months ago
JSON representation
Solution for Number Guess challenge at @freeCodeCamp
- Host: GitHub
- URL: https://github.com/fernandesotero/fcc-number-guess
- Owner: fernandesotero
- Created: 2025-02-24T14:31:02.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-24T23:07:33.000Z (over 1 year ago)
- Last Synced: 2025-10-27T03:35:18.553Z (8 months ago)
- Topics: bash-script, dbms, git, postgresql
- Language: Shell
- Homepage: https://www.freecodecamp.org/learn/relational-database/build-a-number-guessing-game-project/build-a-number-guessing-game
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Number Guessing Game
About
The game is simple. The computer will think of a number between 1 and 100. You will try to guess the number. The computer will tell you if your guess is too high or too low. You will keep guessing until you get the number right.
# Test Cases From FreeCodeCamp
- Create a number_guessing_game folder in the project folder for your program
- Create number_guess.sh in your number_guessing_game folder and give it executable permissions
- Your script should have a shebang at the top of the file that uses #!/bin/bash
- Turn the number_guessing_game folder into a git repository
- Your git repository should have at least five commits
- Your script should randomly generate a number that users have to guess
- When you run your script, you should prompt the user for a username with Enter your username:, and take a username as input. Your database should allow usernames of at least 22 characters
- If that username has been used before, it should print Welcome back, ! You have played games, and your best game took guesses., with being a users name from the database, being the total number of games that user has played, and being the fewest number of guesses it took that user to win the game
- If the username has not been used before, you should print Welcome, ! It looks like this is your first time here.
- The next line printed should be Guess the secret number between 1 and 1000: and input from the user should be read
- Until they guess the secret number, it should print It's lower than that, guess again: if the previous input was higher than the secret number, and It's higher than that, guess again: if the previous input was lower than the secret number. Asking for input each time until they input the secret number.
- If anything other than an integer is input as a guess, it should print That is not an integer, guess again:
- When the secret number is guessed, your script should print You guessed it in tries. The secret number was . Nice job!
- The message for the first commit should be Initial commit
- The rest of the commit messages should start with fix:, feat:, refactor:, chore:, or test:
- You should finish your project while on the main branch, your working tree should be clean, and you should not have any uncommitted changes