指す将総合スレ
■ このスレッドは過去ログ倉庫に格納されています
将棋板は見る将用のスレが非常に多く、指す将からしたら息苦しい。いろんな戦法や中盤感覚、寄せなどについて語り合いましょう。 #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define SENTEBANSYOURITSU 878
#define GOTEBANSYOURITSU 711
int bansyoubu(void);
main(){
int count,number,renpaigaattatitlesen,ichidomorenpaiganai;
ichidomorenpaiganai = 0;
for(count=0;count<1000000;count++){
renpaigaattatitlesen = bansyoubu();
if(renpaigaattatitlesen==0){
ichidomorenpaiganai++;
}
}
printf("一度も連敗が無かったのは %d 回",ichidomorenpaiganai);
} int bansyoubu(void)
{
int ransuu,tsukausyouritsu,kachi,make,zenkaimake,renpaishita,sentedesuka;
kachi = 0;
make = 0;
zenkaimake = 0;
renpaishita = 0;
sentedesuka = 0;
while(1){
if((kachi+make)==0){
ransuu=rand();
ransuu%=1000;
if(ransuu<500){
sentedesuka = 1;
}
}
if(sentedesuka==1){
tsukausyouritsu = SENTEBANSYOURITSU;
}
else{
tsukausyouritsu = GOTEBANSYOURITSU;
}
ransuu=rand();
ransuu%=1000;
if(ransuu<tsukausyouritsu){
kachi++;
zenkaimake = 0;
}
else{
make++;
if(zenkaimake==1){
renpaishita = 1;
}
zenkaimake = 1;
} if((kachi+make)==79){
break;
}
if(sentedesuka==1){
sentedesuka = 0;
}
else{
sentedesuka = 1;
}
}
return renpaishita;
} ■ このスレッドは過去ログ倉庫に格納されています