スカートをCで(2)
実はいろいろ完成度が低いようです。全部チェックするのは大変すぎるので、とりあえず一つだけチェックしました。残りは明日以降にします。ごめんなさい。
/* リボークかどうか判定する関数 */ Boolean playable_or_not(struct person waited,struct playing_info playing_sit){ if(playing_sit.howmany_cards_in_this_trick==0){ return Btrue; } else{ int led; card_into_gametype(playing_sit.ptr_being_played,playing_sit.gametype); card_into_gametype(&(playing_sit.cards_in_this_trick[0]),playing_sit.gametype); led=playing_sit.cards_in_this_trick[0].property.semantic.suit; if((playing_sit.ptr_being_played->property.semantic.suit)==led){ return Btrue; } else{ for(int cnt=0;cnt<10;cnt++){ if(real_card_or_not(waited.hand[cnt])==Btrue){ card_into_gametype(&(waited.hand[cnt]),ptr_sit.gametype); if(waited.hand[cnt].property.semantic.suit==led){ return Bfalse; } } } return Btrue; } } }