プログラミングのお題スレ Part22 (856レス)
プログラミングのお題スレ Part22 http://mevius.5ch.net/test/read.cgi/tech/1691038333/
上
下
前次
1-
新
通常表示
512バイト分割
レス栞
抽出解除
レス栞
444: デフォルトの名無しさん [sage] 2024/10/12(土) 01:39:02.69 ID:OB4ycmPb >>443 #!ruby #encoding: utf-8 $stdout=open("kekka.txt","w") i=100000 #対戦回数 k=0 #勇者の勝ち n=1 #勇者のサイコロの数 hpm=5000 #魔王のHP hpy=1000 #勇者のHP http://mevius.5ch.net/test/read.cgi/tech/1691038333/444
445: デフォルトの名無しさん [sage] 2024/10/12(土) 01:39:40.49 ID:OB4ycmPb >>444 while n<=10 j,t=0,0 while j<i hpy-=rand(1..6) if hpy<=0 j+=1 t,hpy,hpm=0,1000,5000 next end m=0 while m<n hpm-=rand(1..6) m+=1 end if hpm<=0 k+=1 j+=1 t,hpy,hpm=0,1000,5000 next end t+=1 end puts "サイコロ#{n}個で#{i}戦#{k}勝" k,hpy,hpm=0,1000,5000 n+=1 end http://mevius.5ch.net/test/read.cgi/tech/1691038333/445
メモ帳
(0/65535文字)
上
下
前次
1-
新
書
関
写
板
覧
索
設
栞
歴
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.032s