下载此文档

纸牌游戏:十点半.doc


文档分类:生活休闲 | 页数:约27页 举报非法文档有奖
1/27
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/27 下载此文档
文档列表 文档介绍
纸牌游戏:十点半
不能再要牌。,不能再要牌,J,Q,K算为半点。,点大者胜;,则点数最小者赢。
(二)任何一张ints*/
Build_Show(HuaSe, DianShu,ShuZi); /*Establish the card and show it*/
do{
Wash_Card(); /*Wash cards*/
a: puts("\nPlease input the number of the player:");
scanf("%d", &n);
switch(n)
{
case 1:puts("You play with the computer!");
break;
case 2:puts("You two play!");
break;
case 3:puts("You three play!");
break;
case 4:puts("You four play!");
break;
case 5:puts("You five play!");
break;
case 6:puts("You six play!");
break;
case 7:puts("You seven play!");
break;
case 8:puts("You eight play!");
break;
default:puts("The number of the players is too large!");
goto a;
}
Get_Card(n); /*Hand out the cards and give the result*/
do{
puts("\nDo you want to play again?1 represents yes and 0 no:");
scanf("%d", &flag);
}while(flag != 1 && flag != 0);
} while(flag == 1);
}
void Build_Show(int HuaSe[], float DianShu[], char ShuZi[])
{
int i, j;
for(i=0; i<4; i++) /*Establish a pair of cards*/
for(j=0; j<13; j++)
{
Card[j+13*i].color = HuaSe[i];
Card[j+13*i].number = ShuZi[j];
Card[j+13*i].num = DianShu[j];
}
puts("This is a new pair of cards:");
/*Show the whole pair to the players to check*/
for(i=0,j=0; i<52; i++,j++)
{
if(!(j%13))
printf("\n");
printf("%c%c", Card[i].color , Card[i].number);
}
}
void Wash_Card(void)
{
int i,rand1,rand2,hua;
char dian;
float shu;
for(i=0; i<1; i++)
{
rand1=random(52); /*Get a card by random,and put the cards into mess*/
rand2=random(52);
if(rand1!=rand2)
hua=Card[rand1].color;
Card[rand1].color=Card[rand2].color;
Card[rand2].color=hua;
dian=Card[rand1].number;

纸牌游戏:十点半 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数27
  • 收藏数0 收藏
  • 顶次数0
  • 上传人久阅文学
  • 文件大小2.81 MB
  • 时间2022-05-30