Pedantic course requirements


#1


https://www.codecademy.com/courses/javascript-beginner-en-Bthev-mskY8/0/3?curriculum_id=506324b3a7dffd00020bf661#

My code behaves exactly as the program description asks it to. The problem is that the variables you require me to define contradict with the methods I already have defined making it so that I will have to rewrite the entire program to fit your pedantic requirements. The code was working perfectly before. Why does the variable HAVE to be called something specific?

var userChoice = function() {
    var rps = prompt("Rock paper or scissors? (r/p/s");
    if (rps==="r") 
        return 1;
    else if(rps==="p")
        return 2;
    else if(rps==="s")
        return 3;
        
}

var computerChoice = function() {
    var choice = Math.ceil(Math.random() * 3);
    if(choice===1)
        return 1;
    else if(choice===2)
        return 2;
    else
        return 3;
};

var winnerDetermine = function() {
    var user = userChoice();
    var computer = computerChoice();
    if(user===computer)
        winnerDetermine();
    else if((user===1) && (computer===3))
        console.log("You are the winner!");
    else if((user===3) && (computer===2))
        console.log("You are the winner!");
    else if((computer===3) && (user===1))
        console.log("The Computer is the winner!");
    else if((computer===3) && (user===2))
        console.log("The computer is the winner!");
    else
        console.log("It is a tie!");
};

winnerDetermine();


#2

If we gave everyone all the freedom to create the game the way they like it, we would have far to many possible outcomes then we can check with regular expressions, which means humans have to validate all the code of all the users, which is not sustainable.