Class: RpsYsc::Score

Inherits:
Object
  • Object
show all
Defined in:
lib/rps_ysc.rb

Instance Method Summary collapse

Instance Method Details

#judge(w1, w2) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/rps_ysc.rb', line 14

def judge(w1, w2)
    
   #scissor = 1 paper = 2 and rock = 3, the result is based
   #on the production of 2 numbers indeed
   puts "it's a draw" if w1 == w2
   puts "scissor cut paper" if w1 * w2 == 2
   puts "paper surround rock" if w1 * w2 == 6
   puts "rock crack scissor" if w1 * w2 == 3
   
end