メンチン9面待ちプロジェクトその3

昔書いたプログラムの結果はもう少し色々出て来た気がしたので、手牌の同一牌制限を3枚から4枚にしてみたところ、

C:\ruby>mentin13a
"0,1,1,4,1,1,1,1,3"
"0,1,1,4,1,4,1,1,0"
"0,1,4,2,1,1,1,3,0"
"0,3,1,1,1,1,4,1,1"
"0,3,1,1,1,2,4,1,0"
"1,1,4,1,1,1,1,3,0"
"3,1,1,1,1,1,1,1,3"
"3,1,1,1,1,4,1,1,0"
93600

となった。昔見た結果はこれだったのかもしれないな。
これだと厳密には9面待ちにはならないけど。
とりあえずこれでメンチン9面待ちプロジェクトは終了。
折角頭の片隅から昔学んだプログラミングを引っ張り出して来たので、引き続き色々ゲームがらみでプログラム組んで行こうと思う。

今回のコードは以下の通り

# Your code here!
Prime=[1,2,3,5,7,11,13,17,19,23]
t=0
for a in 0..4
for b in 0..4
for c in 0..4
#if a+b+c<1 then;emin=1;else;emin=0;end
if a+b+c>9 then;dmax=13-a-b-c;else;dmax=4;end

for d in 0..dmax
#if a+b+c+d<1 then;emin=1;else;emin=0;end
if a+b+c+d>9 then;emax=13-a-b-c-d;else;emax=4;end

for e in 0..emax
if a+b+c+d+e<1 then;fmin=1-a-b-c-d-e;else;fmin=0;end
if a+b+c+d+e>9 then;fmax=13-a-b-c-d-e;else;fmax=4;end

for f in fmin..fmax
if a+b+c+d+e+f<5 then;gmin=5-a-b-c-d-e-f;else;gmin=0;end
if a+b+c+d+e+f>9 then;gmax=13-a-b-c-d-e-f;else;gmax=4;end

for g in gmin..gmax
if a+b+c+d+e+f+g<9 then;hmin=9-a-b-c-d-e-f-g;else;hmin=0;end
if a+b+c+d+e+f+g>9 then;hmax=13-a-b-c-d-e-f-g;else;hmax=4;end

for h in hmin..hmax
i=13-a-b-c-d-e-f-g-h
t+=1

machi=1

for tumo in 1..9
agari=0

for atama in 1..9
tehai=2**a*3**b*5**c*7**d*11**e*13**f*17**g*19**h*23**i*Prime[tumo]
#if t%1000==0 then;p "#{t},#{tehai}";end

if tehai%Prime[atama]**2==0 then
tehai=tehai/Prime[atama]**2
if tehai%8==0 then;tehai=tehai/8;end
if tehai%30==0 then;tehai=tehai/30;end
if tehai%30==0 then;tehai=tehai/30;end
if tehai%27==0 then;tehai=tehai/27;end
if tehai%105==0 then;tehai=tehai/105;end
if tehai%105==0 then;tehai=tehai/105;end
if tehai%125==0 then;tehai=tehai/125;end
if tehai%385==0 then;tehai=tehai/385;end
if tehai%385==0 then;tehai=tehai/385;end
if tehai%343==0 then;tehai=tehai/343;end
if tehai%1001==0 then;tehai=tehai/1001;end
if tehai%1001==0 then;tehai=tehai/1001;end
if tehai%1331==0 then;tehai=tehai/1331;end
if tehai%2431==0 then;tehai=tehai/2431;end
if tehai%2431==0 then;tehai=tehai/2431;end
if tehai%2197==0 then;tehai=tehai/2197;end
if tehai%4199==0 then;tehai=tehai/4199;end
if tehai%4199==0 then;tehai=tehai/4199;end
if tehai%4913==0 then;tehai=tehai/4913;end
if tehai%7429==0 then;tehai=tehai/7429;end
if tehai%7429==0 then;tehai=tehai/7429;end
if tehai%6859==0 then;tehai=tehai/6859;end
if tehai%12167==0 then;tehai=tehai/12167;end
if tehai==1 then;agari=1;else;agari=0;end
end

if agari==1 then;break;end
end #for atama

if agari==1 then;machi=machi*Prime[tumo];end
end #for tumo

if machi==223092870 then;p "#{a},#{b},#{c},#{d},#{e},#{f},#{g},#{h},#{i}";end

end
end
end
end
end
end
end
end
p t

< 2024年05月 >
S M T W T F S
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
QRコード
QRCODE
インフォメーション
長野県・信州ブログコミュニティサイトナガブロ
ログイン

ホームページ制作 長野市 松本市-Web8

アクセスカウンタ
読者登録
メールアドレスを入力して登録する事で、このブログの新着エントリーをメールでお届けいたします。解除は→こちら
現在の読者数 0人
プロフィール
nishiken