Skip to content

Madyy Khoussa & obaid Rustemi#66

Open
pursuitMaddy wants to merge 1 commit into
joinpursuit:mainfrom
pursuitMaddy:main
Open

Madyy Khoussa & obaid Rustemi#66
pursuitMaddy wants to merge 1 commit into
joinpursuit:mainfrom
pursuitMaddy:main

Conversation

@pursuitMaddy

Copy link
Copy Markdown

really not getting why the random number and number not registering

Comment thread game.js

const gameLoop = () => {};
startGame();
if (rls.keyInYN('Hey want to play?')) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code belongs in a function

Comment thread game.js
*
* @returns {number} - a number between 1 and 1000
*/
const generateRandomNumber = () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is doing way too much. All this function should do is return a number between 1 and 1000. Use google to help you find how to make a random number in that range.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello Corey'

Thank you for the comment I also agree it is doing way way way way to much ;
below is what i simplified it to and it work.
const generateRandomNumber = () => {
let number = (Math.random() * 1000);
return number;

IvanCastillo1986 pushed a commit to IvanCastillo1986/Guessing-Game-cli-lab that referenced this pull request Feb 4, 2021
add some syntax highlighting and small wording edits
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