Newer
Older
Ruby / jyankenj.rb
@TAGA Koichi TAGA Koichi on 1 Oct 2021 997 bytes 2021-10-01 20:10:17
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-



  
  






  
    print"じゃんけんスタート!1(✊)または2(✌)または3(✋)を入力してください。"

    te=["1","2","3"]
    te[rand(te.length)]
    print"自分が出した手を数字で入力"
    

    while true
      





      te=gets.to_i

      printf("あなたが出したのは%dです。\n",te)

      sleep(3)
      

      ti=rand(te.lent)

      printf("相手が出したのは、%dです。\n",ti)

      if te >ti
        print"あなたの勝ちです!!"
      else
        print"あなたの負けです😢"
      end


      while true 

        print"もう一度やりますか?"







        if mouitido=="やる"
          mouitido=gets.chomp.to_i
          redo

          if mouitido=="やらない"
            break


          elsif
            puts"その選択肢はないよ"
            redo
            
          end