I'm trying to make a Rock Paper Scissors coding challenge for myself, and I got a simple version with a text box, so no I'm trying to make it with buttons, I have made it very far through, I'm just on the last step.
So what I want to do is take the info from the rock(), paper(), and scissors() functions and go further
This is what I have so far
var playerInput = "blank"
function rock(playerInput) {
this.playerInput = playerInput;
playerInput = "rock";
}
function paper(playerInput) {
this.playerInput = playerInput;
playerInput = "paper";
}
function scissors() {
this.playerInput = playerInput;
playerInput = "scissors";
}
and what I want to do from there is take it into another function where I have already created the game itself.
I've tried
var rock = rock();
console.log(rock.playerInput);
and it didn't work please help.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…