Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,25 @@
const logic = {
rock: { w: 'scissor', l: 'paper'},
paper: {w:'rock', l:'scissor'},
scissor: {w:'paper', l:'rock'},
}
class Player {
constructor(name){
this.name = name;
}
setChoice(choice){
this.choice = choice;
}
challengeOther(PlayerTwo){
return logic[this.choice].w === PlayerTwo.choice;
}
}
const p1 = new Player('Chris');
const p2 = new Player('John');
p1.setChoice('rock');
p2.setChoice('scissor');
p1.challengeOther(p2); //true (Win)