-1
- (INNER JOIN) Make an algorithm named after two players and then ask for 5 numbers from 1 to 10 for each player. First for player A and then for player B. After the choice of each player the algorithm must present which were the equal numbers that player A and B have placed. EX: Player A: 1, 2, 3, 4, 5 Player B : 1,2,3,8,7 Algorithm prints: 1,2,3
var rs = require('readline-sync')
var a = []
var b = []
var nome1 = rs.question('Digite o nome do primeiro jogador : ')
var nome2 = rs.question(' Digite o nome do segundo jogador : ')
console.log('Digite 5 notas de 0 a 10 para o Primeiro jogador :')
for(i = 5; i > 0 ; i--)
{ var nota = rs.questionInt('Nota : ')
a.push(nota)
}
console.log(a)
console.log('Digite 5 notas de 0 a 10 para o Segundo jogador :')
for(i = 5; i > 0 ; i--)
{ var nota = rs.questionInt('Nota : ')
b.push(nota)
}
console.log(b)
valeu rodou legal, I’m starting now but I’ll give a att in the variables to not use var more...
– Luiz F
If I were to do the reverse, compare different numbers of A and B as I would?
– Luiz F