Skip to content
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

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

daniel puzhenko #7

wants to merge 17 commits into from

Conversation

danpuz
Copy link

@danpuz danpuz commented Jan 7, 2025

No description provided.

@@ -0,0 +1,60 @@
const randomNumber = Math.floor(Math.random() * 20) + 1;
var guess;
Copy link
Owner

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) {
Copy link
Owner

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

danpuz and others added 10 commits January 11, 2025 11:04
- 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
…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) {
Copy link
Owner

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);
Copy link
Owner

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

@dolevoper
Copy link
Owner

Please don't use Hebrew characters nor spaces when naming files/folders

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants