Skip to content

ivanextrastuff/golf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Game Instructions

Welcome to "Guess the Number"! You have to guess the random number between 1-100 generated by the computer. When you take your guess, the computer calculates if your number is higher or lower than the random number and it will decrease the range based on your guess. Try to get the number in the least number of guesses!

What my code does

The code is exactly 500 characters. I spent most of the time just to cut down the characters so the code format will not be great for reading.

  • My code has a validation therefore if user types in invalid inputs, e.g., not a number, number out of range. If the input is invalid, the input will be reprompted.
  • My code has a hint: When the player guesses more than 5 times, it gives a hint of the number if its odd or even.
  • My code calculates how many times you have guessed and compare it with your best guess which is recorded in a json file.

Bugs

There were a few times where it had a syntax error: JSON has an unexpected ending. Then I realised that the json file wasn't initialised. I then added {} in the json file and it worked.

Comments

I have tried to add audios to the game and they play when users get the answer right or wrong. Even though I have added the bun files but the sound still didn't play, so I gave up on that idea.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors