admin 管理员组文章数量: 887021
2023年12月22日发(作者:sect有切割的意思吗)
{ x = rand() % (n + 1); while (x != 0 && (player[x].life == 0 || x == i)) { Sleep(rand() % 98); srand(time(0)); x = rand() % (n + 1); } if (x == 0) cout << i << "号玩家弃权" << endl; else cout << i << "号玩家投给了" << x << "号玩家" << endl; } } if (x != 0) TOU[x].xxx++; } } Sleep(3000); sort(TOU + 1, TOU + n + 1, cmp); if (TOU[2].xxx != TOU[1].xxx) { cout << "投票结束," << TOU[1].num << "号投票出局" << endl; player[TOU[1].num].life = 0; player[TOU[1].num].how = 2; Sleep(3000); return; } else { TOU[1].toupiaoquan = 0; TOU[2].toupiaoquan = 0; system("cls"); print(ddd, nnn); cout << TOU[1].num << "号," << TOU[2].num << "号"; int i; for (i = 3; i <= n; i++) { if (TOU[i].xxx == TOU[1].xxx) { TOU[i].toupiaoquan = 0; cout << "," << TOU[i].num << "号"; } else break; } if (i == n + 1) { for (int i = 1; i <= n; i++) TOU[i].toupiaoquan = 1; } cout << "平票" << endl; } //--------2-------- sort(TOU + 1, TOU + n + 1, cmp1);
{ x = rand() % (n + 1); while (x != 0 && (player[x].life == 0 || x == i || TOU[x].toupiaoquan == 1)) { srand(time(0)); x = rand() % (n + 1); } if (x == 0) cout << i << "号玩家弃权" << endl; else cout << i << "号玩家投给了" << x << "号玩家" << endl; } } if (x != 0 && TOU[i].toupiaoquan == 1) TOU[x].xxx++; } } Sleep(3000); sort(TOU + 1, TOU + n + 1, cmp); if (TOU[2].xxx != TOU[1].xxx) { cout << "投票结束," << TOU[1].num << "号投票出局" << endl; player[TOU[1].num].life = 0; player[TOU[1].num].how = 2; Sleep(3000); return; } else { TOU[1].toupiaoquan = 0; TOU[2].toupiaoquan = 0; system("cls"); print(ddd, nnn); cout << TOU[1].num << "号," << TOU[2].num << "号"; int i; for (i = 3; i <= n; i++) { if (TOU[i].xxx == TOU[1].xxx) { TOU[i].toupiaoquan = 0; cout << "," << TOU[i].num << "号"; } else break; } if (i == n + 1) { for (int i = 1; i <= n; i++) TOU[i].toupiaoquan = 1; } cout << "平票" << endl; } //--------3-------- sort(TOU + 1, TOU + n + 1, cmp1); cout << "请再次投票"; for (int i = 1; i <= 3; i++)
#define MOD 28#define SIZE_N 19#define SIZE_M 12
int cur_x,cur_y;int score,mark,next,map[SIZE_N][SIZE_M],Gamespeed=300;
int shape[28][6]={ {0,-1,0,-2,1,0}, {0,1,1,0,2,0}, {-1,0,0,1,0,2}, {0,-1,-1,0,-2,0}, {0,-1,0,1,-1,0}, {0,1,1,0,-1,0}, {1,0,0,-1,0,1}, {1,0,-1,0,0,-1}, {-1,1,0,1,1,0}, {0,-1,1,0,1,1}, {-1,0,0,-1,1,-1}, {-1,-1,-1,0,0,1}, {-1,0,0,1,1,1}, {0,1,1,-1,1,0}, {-1,0,0,1,1,1}, {0,1,1,-1,1,0}, {-1,0,0,-1,0,-2}, {-1,0,-2,0,0,1}, {0,1,0,2,1,0}, {0,-1,1,0,2,0}, {0,1,1,0,1,1}, {0,-1,1,0,1,-1}, {-1,0,0,-1,-1,-1}, {-1,0,-1,1,0,1}, {0,1,0,2,0,3}, {1,0,2,0,3,0}, {0,-1,0,-2,0,-3}, {-1,0,-2,0,-3,0}};
void gotoxy(int x,int y){ COORD c; c.X=x-1; c.Y=y-1; SetConsoleCursorPosition (GetStdHandle(STD_OUTPUT_HANDLE), c);}void Gameover(){ int i,j,flag=0; for(j=1;j if(map[ x+shape[id][i] ][ y+shape[id][i+1] ]!=0)return 0; }return 1;} void fun_score(){ int i,j,ii,jj; for(i=1;i int main(){ int i,id,set=1; srand(time(NULL)); id=rand()%MOD; id=(id+MOD)%MOD; next=rand()%MOD; next=(next+MOD)%MOD; init(id); while(1){Here: mark=0; if(set==0){ id=next; next=rand()%MOD; next=(next+MOD)%MOD; cur_x=0;cur_y=5; set=1; } while(!kbhit()){ Gameover(); if(judge_in(cur_x+1,cur_y,id)==1) cur_x++; else { map[cur_x][cur_y]=2; break; } } } return 0;}
版权声明:本文标题:c++小游戏大集结【免费复制源码】 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/free/1703226779h443058.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论