Skip to content

Instantly share code, notes, and snippets.

@robinator
Created September 20, 2010 16:08
Show Gist options
  • Save robinator/588146 to your computer and use it in GitHub Desktop.
Save robinator/588146 to your computer and use it in GitHub Desktop.
rob = [
%w{Lakers 5},
%w{Nuggets 5},
%w{Suns 6},
%w{Spurs 6},
%w{Cavs 5},
%w{Celtics 5},
%w{Hawks 5},
%w{Magic 6},
%w{Lakers 6},
%w{Spurs 7},
%w{Cavs 7},
%w{Magic 6},
%w{Spurs 7},
%w{Cavs 7},
%w{Spurs 7}
]
manny = [
%w{Lakers 6},
%w{Nuggets 7},
%w{Suns 5},
%w{Spurs 7},
%w{Cavs 5},
%w{Celtics 6},
%w{Hawks 5},
%w{Magic 5},
%w{Lakers 5},
%w{Suns 5},
%w{Cavs 5},
%w{Magic 5},
%w{Lakers 5},
%w{Cavs 5},
%w{Lakers 7}
]
max = [
%w{Lakers 5},
%w{Nuggets 7},
%w{Suns 6},
%w{Mavs 6},
%w{Cavs 4},
%w{Celtics 7},
%w{Hawks 5},
%w{Magic 7},
%w{Lakers 7},
%w{Mavs 6},
%w{Cavs 5},
%w{Magic 5},
%w{Lakers 7},
%w{Cavs 6},
%w{Cavs 6}
]
real = [
%w{Lakers 6},
%w{Jazz 6},
%w{Suns 6},
%w{Spurs 6},
%w{Cavs 5},
%w{Celtics 5},
%w{Hawks 7},
%w{Magic 4},
%w{Lakers 4},
%w{Suns 4},
%w{Celtics 6},
%w{Magic 4},
%w{Lakers 6},
%w{Celtics 6},
%w{Lakers 7}
]
def evaluate(real, bracket)
team = games = 0
real.each_index do |i|
team += 1 if real[i].first == bracket[i].first
games += 1 if real[i].last == bracket[i].last
end
puts "Team Points: #{team}"
puts "Game Points: #{games}"
puts "Total: #{team + games}"
puts "\n\n"
end
puts "Rob..."
evaluate(real, rob)
puts "Manuel..."
evaluate(real, manny)
puts "Max..."
evaluate(real, max)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment