-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
daniel puzhenko #7
base: main
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,60 @@ | |||
const randomNumber = Math.floor(Math.random() * 20) + 1; | |||
var guess; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use var
if (guess > randomNumber) { | ||
alert("Sorry, you guessed too high"); | ||
} | ||
else if (guess < randomNumber) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be just else
- mutually exclusive
- Introduced a new TypeScript file for calculating the average of user-inputted numbers. - Removed outdated calculator HTML and TypeScript files to streamline the project.
…eration prompts, and remove old guessing game functionality
…or min and max operations, and add a .gitignore file to exclude specific settings
…d operations and displaying the student with the lowest grade
…lculation with alerts for invalid entries
…starting a new game, changing settings, and quitting; improve input handling for difficulty, number of guesses, and play mode
let numberCount = 0; | ||
let userInput = Number(prompt("Enter a number")); | ||
|
||
while (userInput !== null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the input is immediately cast to number
, this condition would always be true and we get an infinite loop.
let userInput = Number(prompt("Enter a number")); | ||
|
||
while (userInput !== null) { | ||
let number = Number(userInput); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be const, this variable does not change value during runtime
Please don't use Hebrew characters nor spaces when naming files/folders |
No description provided.