You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
418 B

var games = []
do {var ticket = Math.floor(Math.random() * (+20 - +1) + +1)
var seats = Math.floor(Math.random() * (+15 - +5) + +5)
var pot = seats * ticket
var round = Math.floor(pot/5)*5
var take = pot - round
var game=[seats, ticket, pot, round, take]
if (true) {
if (games.indexOf(game) === -1) {games.push(game)}
}
}
while ( games.length < 1 )
console.log(games.sort())