Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 15 lines (11 sloc) 0.439 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Rock Paper Scissors Tournament

Use:

  irb -rlib/tournament
  
  >> @t = Tournament.new([RockThrower, PaperThrower])
  => #<Tournament:0x5cf544 @seed=[RockThrower, PaperThrower], @players=[RockThrower, PaperThrower], @matches=[[RockThrower, PaperThrower]]>
  >> @t.run
  PLAYERS: [RockThrower, PaperThrower]
  #<PaperThrower:0x5cc790> won 100% of the time
  #<PaperThrower:0x5cc790> wins the tournament
  => #<PaperThrower:0x5cc790>
  >>
Something went wrong with that request. Please try again.