Newer
Older
Ruby / jyanken2.rb
@TAGA Koichi TAGA Koichi on 10 Oct 2021 441 bytes 2021-10-10 10:56:40
#!/usr/bin/env ruby
# coding: utf-8
a=0

while a==0
  puts"じゃんけんスタート!"
  puts"1(グー)、2の(チョキ)、3の(パー)のどれかを入力してね!"
te=["1","2","3",]

  puts"数字を入力"
 my=gets.to_i 
 printf"あなたが出したのは、%dです。\n",my
# cp=rand(3)+1
cp=2
 printf"相手が出したのは、%dです。\n",cp

 if my==1&&cp==2||my==2&&cp==3||my==3&&cp==1
   system"banner you winer"
 end
end