Please help meQAQ

alert('This is a rock paper scissor game');

let answer =prompt('input');

let number00 =Math.floor(Math.random()*3);

let thing =function(number00){
    if (number00=0) {
        thing= 'rock'
    }else if (number00=1){
        thing='paper'
    }else if (number00=2) {
        thing='scissor'
    } 
};
if (((answer='rock')&&(thing ='scissor'))||((answer='scissor')&&(thing ='paper'))||((answer='paper')&&(thing ='rock'))) {
    document.getElementById('win').innerHTML='win'
}else if (((answer='scissor')&&(thing ='rock'))||((answer='paper')&&(thing ='scissor'))||((answer='rock')&&(thing ='paper'))) {
    document.getElementById('lose').innerHTML='lose'
}else if (((answer='rock')&&(thing ='rock'))||((answer='scissor')&&(thing ='scissor'))||((answer='paper')&&(thing ='paper'))) {
    document.getElementById('tie').innerHTML='tie'    
}else()=>console.log('?')

``` :wink:

Hi @ewen0928

  1. You cannot reassign a variable within a function that is assigned to that variable. Return from the function thing instead.
  2. You must call your function thing somewhere.
  3. Check if you’re using a comparison operator where you want to check whether a condition is true or false rather than an assignment operator.
1 Like