Skip to content

Instantly share code, notes, and snippets.

@Uriel29
Created September 14, 2020 18:28
Show Gist options
  • Save Uriel29/2f1cfdafabc85c4eb7d626df178b77cf to your computer and use it in GitHub Desktop.
Save Uriel29/2f1cfdafabc85c4eb7d626df178b77cf to your computer and use it in GitHub Desktop.
4/5
let n = gets()
for (let i = 0; i < n; i++) {
let t = gets();
let jogoArray = t.split(' ');
let [fernanda, marcia] = jogoArray;
if (fernanda == "tesoura") {
if (marcia == "tesoura") {
console.log("empate");
}
if (marcia == "papel" || marcia == "lagarto") {
console.log("fernanda");
}
if (marcia == "pedra" || marcia == "spock") {
console.log("marcia");
}
}
if (fernanda == "papel") {
if (marcia == "papel") {
console.log("empate");
}
if (marcia == "pedra" || marcia == "spock") {
console.log("fernanda");
}
if (marcia == "lagarto" || marcia == "tesoura") {
console.log("marcia");
}
}
if (fernanda == "pedra") {
if(marcia == "pedra") {
console.log("empate");
}
if (marcia == "tesoura" || marcia == "lagarto") {
console.log("fernanda");
}
if (marcia == "papel" || marcia == "spock") {
console.log("marcia");
}
}
if (fernanda == "lagarto") {
if (marcia == "lagarto") {
console.log("empate");
}
if (marcia == "spock" || marcia == "papel") {
console.log("fernanda");
}
if (marcia == "tesoura" || marcia == "pedra") {
console.log("marcia");
}
}
if (fernanda == "spock") {
if (marcia == "spock") {
console.log("empate");
}
if (marcia == "tesoura" || marcia == "pedra") {
console.log("fernanda");
}
if (marcia == "papel" || marcia == "lagarto") {
console.log("marcia");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment