def rand_outcome(num_games=15) o = Array.new(num_games,0) for i in 0..num_games o[i] = rand(2) end return o end def round_eliminated(team,outcome) elim = 0 w = winners[outcome] for round in 0..3 elim = elim+1 if w[ggn(team,round)] == team end return elim end def advanced_further(team1,team2, outcome) return round_eliminated(team1,outcome) > round_eliminated(team2,outcome) end