Commit dfb28cb5 authored by s8_vaitku_e's avatar s8_vaitku_e
Browse files

Delete GuessTheNumber.js

parent 05450579
import { useEffect, useState } from 'react';
import './GuessTheNumber.scss';
const GuessTheNumber = props => {
function guessNumber() {
const random = Math.floor(Math.random() * 100) + 1;
let number = parseInt(prompt('Guess a number from 1 to 100: '));
while(number !== random) {
number = parseInt(prompt('Guess a number from 1 to 100: '));
}
if(number == random) {
console.log('You guessed the correct number.');
break;
}
}
guessNumber();
};
export default GuessTheNumber;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment