2019-02-06 04:51:50 Ruby

再帰じゃんけん

Copy Copied! Full
def rsp i,j=%w(r s p),%w(%w(s p) %w(p r) %w(r s)) p "plz imput(r||s||p)" (x=gets.chomp)!=(y=i[rand(0...3)])? (return j[i.index(x)][0]==y ? "w!":"l!") : rsp end puts rsp
再帰じゃんけん
RECOMMEND