Skip to content

Instantly share code, notes, and snippets.

@evanphx
Created August 8, 2014 17:37
Show Gist options
  • Save evanphx/6bcc1599315b309b9bbd to your computer and use it in GitHub Desktop.
Save evanphx/6bcc1599315b309b9bbd to your computer and use it in GitHub Desktop.
bitjockies draft order selection algorithm
urls = %w!
https://www.youtube.com/watch?v=lYIRO97dhII
https://www.youtube.com/watch?v=IM2MCCd-EnA
https://www.youtube.com/watch?v=LkCNJRfSZBU
https://www.youtube.com/watch?v=FtW7eaSvd6A
https://www.youtube.com/watch?v=sTSA_sWGM44
https://www.youtube.com/watch?v=21OH0wlkfbc
https://www.youtube.com/watch?v=e2jjCMgGOYw
https://www.youtube.com/watch?v=b2LseRItJb4
!
names = [
"Evan Phoenix",
"Jessica Eldredge",
"Chris Eldredge",
"Sara Flemming",
"Chris Morris",
"Abby Phoenix",
"Adam Keys",
"Jeff Casimir",
"Ben Scofield",
"Dave Sims",
"Andrew Thorp",
"Marty Haught"
]
seed = urls.inject(0) { |a,i| a ^ i.split(//).inject(0) { |b,j| b ^ j.ord } }
puts "Random seed for MOST IMPORTANT draft selection is: #{seed}"
srand seed
names.shuffle.each_with_index do |n,i|
printf "% 2d %s\n", i+1, n
end
__END__
Random seed for MOST IMPORTANT draft selection is: 23
1 Jeff Casimir
2 Jessica Eldredge
3 Chris Eldredge
4 Dave Sims
5 Marty Haught
6 Chris Morris
7 Abby Phoenix
8 Evan Phoenix
9 Andrew Thorp
10 Ben Scofield
11 Adam Keys
12 Sara Flemming
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment