I\'m a novice ruby programmer and although this code works, I\'m wondering how I can improve it. I have very limited knowledge on lambdas and procs and the like, but any advice
ROLL_OPS = %w[rock paper scissors] RESULTS = %w[tie lose win] def rps(roll) unless i = ROLL_OPS.index(roll) return puts "Please input rock paper or scissors".freeze end pick = ROLL_OPS.sample puts "#{pick}, #{RESULTS[(i - ROLL_OPS.index(pick)) % 3]}" end