5/6 - Logical operators


#1

I have a little bit of an issue trying to use if/else in my switch. So I want a random variable to decide whether the user dies or not. The problem I have is that I always land on else. Look at example below:

var user = prompt("You are the last survivor on your space station. Suddenly you hear a loud, scrangling noise.     What do you do? *INVESTIGATE*, *HIDE*, *SEARCH FOR WEAPONS*.").toLowerCase();

var randomDeath = Math.floor(Math.random()*5);

switch(user) {

case 'investigate':
    console.log('*You go to investigate the strange sound*');
    if (randomDeath > 1 && randomDeath !== 1){
        console.log('When you arrive at the location the sound came \
        from, there doesnt seem to be anything here');
    }
    else {
        console.log('You suddenly hear something thats really close, \
        only a few seconds later, you get grabbed by something and brutally disembered. You die.');
    }
    break;
case 'hide':
    console.log('*You get scared and decides to go hide somewhere*');
    if (randomDeath === 2 || randomDeath === 5) {
        console.log('You successfully find a place to hide, but how long can you stay there?');
    }
    else {
        console.log('Hiding from something unidentifiable is a bad decition. You get found and killed.');
    }
    break;
case 'search for weapons':
    console.log('*You decide the best course of action, is to be ready for whatever might lurk in the shadows.*');
    if (randomDeath < 5) {
        console.log('You find yourself in the armory where plenty of weapons are available.');
    }
    break;
default:
    console.log('*You are uncertain what you should do, and decide to ignore the sound*');
    if (randomDeath < 5) {
        console.log('Waiting around never made sense. Whatevers lurking in the shadows find and kills you. Game over.');
    }
    break;
}

#2

You are multiplying your random variable by 5. So it is always getting a higher value


#3

But then the first if should always kick in, and it doesn't.