fized formatting
parent
68cfd1d819
commit
1fd63649f6
|
@ -1,4 +1,6 @@
|
|||
#!/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'pry'
|
||||
|
||||
def score(opponent, me)
|
||||
|
@ -13,9 +15,9 @@ def score(opponent, me)
|
|||
return 3 + base if opponent == me
|
||||
|
||||
outcome = 0
|
||||
outcome = 6 if opponent == :rock and me == :paper
|
||||
outcome = 6 if opponent == :paper and me == :scissors
|
||||
outcome = 6 if opponent == :scissors and me == :rock
|
||||
outcome = 6 if (opponent == :rock) && (me == :paper)
|
||||
outcome = 6 if (opponent == :paper) && (me == :scissors)
|
||||
outcome = 6 if (opponent == :scissors) && (me == :rock)
|
||||
|
||||
outcome + base
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue