1
已解决
曹灿阳
初级天翼
初级天翼
我对一些游戏做了一些整改,具体如下:
张帆——NC5.0
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <bits/stdc++.h>
#include <windows.h>
#include <fstream>
#include <iomanip>
using namespace std;
struct j{
string fire;//技能名字
string fine;//对敌人造成的伤害
};
struct chacracter{
string name;
int HP,G,Z;
j ay;
int idx,num;
string turn_num="";
string wy_num="";
int go_upper=0;
string kill;
int times;
}; /*
HP:血量
G:攻击力
Z:智力
ay:特技
idx:所在队伍
num:人物编号
*/
int n=1;
chacracter c[110];
j how[30];//技能
void color(int corcorcor){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),corcorcor+240);
}
void give_num_to_how_a_fine_work(){
how[1].fire="火球术",how[1].fine="100";
how[2].fire="心灵控制",how[2].fine="10+turn";
how[3].fire="地裂术",how[3].fine="25+every";
//how[4].fire="铁壁",how[4].fine="0+fend";//fend防守
how[4].fire="瘟疫",how[4].fine="20+wy";//wy感染
how[5].fire="懒癌",how[5].fine="20+wy";//wy感染
//how[7].fire="回避攻击",how[8].fine="0+fend";
how[6].fire="终极一击",how[6].fine="200+every+wy";
how[7].fire="皇天冲击",how[7].fine="230+every+wy";
how[8].fire="新冠病毒",how[8].fine="280+wy";
how[9].fire="代码冲击",how[9].fine="290+turn";
how[10].fire="文理双翼",how[10].fine="666";
return ;
}
void out(string said){
for(int i=0;i<said.length();i++){
cout<<said[i];
Sleep(50);
}
return ;
}//输入一个字符串,每5毫秒输出一个字符
void ano(){
cout<<"\n";
return ;
}//换行简写
void begin(){
out("欢迎来到NC 5.0");
//ano();
//ano();
Sleep(1000);
system("cls");
out("下面请输入名字,按enter+enter分队,禁止外挂,若系统发现外挂,自动退游,最多支持100个名字对战,超出可能会报错。");
ano();
out("按enter+(ctrl+z)+enter(注:分开按)结束输入,开始对战");
Sleep(5000);
//cout<"\n";
system("cls");
return ;
}//开始对白
void give_num_to_people(int id){
int x=rand()%5+1;
c[id].ay.fire=how[x].fire;
c[id].ay.fine=how[x].fine;
if(c[id].name.find("king",0)!=-1){
c[id].ay.fire=how[6].fire;
c[id].ay.fine=how[6].fine;
}
if(c[id].name.find("dragon",0)!=-1){
c[id].ay.fire=how[7].fire;
c[id].ay.fine=how[7].fine;
}
if(c[id].name.find("covid",0)!=-1){
c[id].ay.fire=how[8].fire;
c[id].ay.fine=how[8].fine;
}
if(c[id].name.find("coder",0)!=-1){
c[id].ay.fire=how[9].fire;
c[id].ay.fine=how[9].fine;
}
if(c[id].name.find("student",0)!=-1){
c[id].ay.fire=how[10].fire;
c[id].ay.fine=how[10].fine;
}
c[id].HP=rand()%201+200;
c[id].G=rand()%41+10;
c[id].Z=rand()%100+1;
return ;
}//对于每一个人物,生成属性。
void in(){
int ans=1;
while(getline(cin,c[n].name)){
if(c[n].name.empty()){
ans++;
} else {
c[n].idx=ans;
c[n].num=n;
c[n].kill="none_people_kill_him";
give_num_to_people(n);
n++;
}
//give_num_to_people(n);
//cout<<n<<" "<<c[n].HP<<" "<<c[n].G<<" "<<c[n].Z<<" "<<c[n].idx<<"\n";
}
n--;
if(n<2||n>100){
MessageBox(NULL,"WRONG","name-computation",MB_OK);
MessageBox(NULL,"teams-begong","name-computation",MB_OK);
system("cls");
cout<<"the name team has no number to fight\n";
cout<<"INF\n";
for(int i=1;i<=0x7f7f7f7f;i++){
int pos=rand()%120+1;
//if(pos==0) exit(0);
int flag=rand()%2;
if(flag==1) cout<<pos;
else cout<<(char)pos;
}
system("cls");
exit(0);
}
if(ans==1){//单斗模式
//int poster=1;
for(int i=1;i<=n;i++){
c[i].idx=i;
}
}
return ;
}//输入
void fight_begin_out(){
system("cls");
for(int i=1;i<=n;i++){
color(c[i].idx);
cout<<(char)(c[i].idx+'A'-1)<<":";
cout<<c[i].name<<" ";
cout<<"HP:"<<c[i].HP<<" ";
cout<<"攻:"<<c[i].G<<" ";
cout<<"智:"<<c[i].Z<<" ";
//cout<<"队伍:"<<c[i].idx<<" ";
ano();
//if(c[i].idx!=c[i-1].idx) ano();
}
color(0);
cout<<"_____________________________________________________\n";
return ;
}//开始输出属性
bool check(){
int pos=0,cnt=0;
for(int i=1;i<=n;i++){
if(c[i].HP>0){
if(c[i].idx!=pos){
pos=c[i].idx;
cnt++;
}
}
}
return cnt>1;
}
int turn(string s){
int sum=0;
for(int i=0;i<s.length();i++){
if(!(s[i]>='0'&&s[i]<='9')) break;
sum=sum*10+(int)(s[i]-'0');
}
return sum;
}
void fight(){
int now_turn=0;
while(check()){
//cout<<"yes\n";
now_turn=now_turn%n+1;
if(c[now_turn].HP==0) continue;
if(c[now_turn].times==3){
c[now_turn].turn_num="";
c[now_turn].wy_num="";
}
int pos=rand()%3+1;//出招与 否
//if(c[now_turn].ay.fire=="铁壁"||c[now_turn].ay.fire=="回避攻击"){
// pos=2;
//}
int names_you_go=rand()%n+1;
while(c[names_you_go].idx==c[now_turn].idx||c[names_you_go].HP<=0) names_you_go=rand()%n+1;
int yes=rand()%10+1;
if(c[now_turn].turn_num=="yes") names_you_go=now_turn;
switch(pos){
case 3:{//出技能
cout<<c[now_turn].name<<" 使用了 "<<c[now_turn].ay.fire<<",\n";
int flag=c[now_turn].ay.fine.find("every",0);
if(flag==-1){
if(yes==1){
cout<<c[names_you_go].name<<" 回避了攻击 。\n";
} else {
int fight_num=turn(c[now_turn].ay.fine);
//if(!c[now_turn].ay.fire)
cout<<c[names_you_go].name<<" 受到了 "<<fight_num<<"点伤害";
c[names_you_go].HP-=fight_num;
if(c[names_you_go].HP<0) c[names_you_go].HP=0;
if(c[names_you_go].HP==0){
cout<<" "<<c[names_you_go].name<<"被击倒了";
c[now_turn].go_upper++;
c[names_you_go].kill=c[now_turn].name;
break;
}
if(c[now_turn].ay.fine.find("turn",0)!=-1){
cout<<","<<c[names_you_go].name<<" 被鬼魅了 ";
c[names_you_go].turn_num="yes";
}
if(c[now_turn].ay.fine.find("wy",0)!=-1){
cout<<","<<c[names_you_go].name<<" 被感染了 ";
c[names_you_go].wy_num="yes";
}
}
ano();
} else {
int fight_num=turn(c[now_turn].ay.fine);
for(int i=1;i<=n;i++){
if(c[i].HP<=0) continue;
if(c[i].idx==c[names_you_go].idx){
cout<<" "<<c[i].name<<" 受到了 "<<fight_num<<"点伤害";
c[i].HP-=fight_num;
if(c[i].HP<=0){
c[i].HP=0;
cout<<","<<c[i].name<<"被击倒了;\n";
c[now_turn].go_upper++;
c[i].kill=c[now_turn].name;
continue;
}
if(c[now_turn].ay.fine.find("turn",0)!=-1){
cout<<","<<c[i].name<<" 被鬼魅了 ";
c[i].turn_num="yes";
}
if(c[now_turn].ay.fine.find("wy",0)!=-1){
cout<<","<<c[i].name<<" 被感染了 ";
c[i].wy_num="yes";
}
cout<<"\n";
}
}
}
break;
}
default:{//出普通攻击
cout<<c[now_turn].name<<"发起攻击,";
if(yes==1){
cout<<c[names_you_go].name<<" 回避了攻击 。\n";
} else {
int fight_num=c[now_turn].G;
//if(!c[now_turn].ay.fire)
cout<<c[names_you_go].name<<" 受到了 "<<fight_num<<"点伤害";
c[names_you_go].HP-=fight_num;
if(c[names_you_go].HP<0) c[names_you_go].HP=0;
if(c[names_you_go].HP==0){
cout<<" "<<c[names_you_go].name<<"被击倒了\n";
c[now_turn].go_upper++;
c[names_you_go].kill=c[now_turn].name;
}
//if(c[now_turn].ay.fine.find("turn",0)!=-1){
// cout<<","<<c[names_you_go].name<<" 被鬼魅了 ";
// c[names_you_go].turn_num="yes";
//}
//if(c[now_turn].ay.fine.find("wy",0)!=-1){
// cout<<","<<c[names_you_go].name<<" 被感染了 ";
// c[names_you_go].wy_num="yes";
//}
ano();
}
break;
}
}
if(c[now_turn].wy_num=="yes"){
cout<<" "<<c[now_turn].name<<"病毒发作,收到了50点伤害,";
c[now_turn].HP-=50;
if(c[names_you_go].HP==0){
cout<<c[now_turn].name<<"被击倒了\n";
//c[now_turn].go_upper++;
}
ano();
}
c[now_turn].times++;
Sleep(500);
cout<<endl;
}
return ;
}
void last_out(){
//cout<<turn("100");
ano();
ano();
cout<<"输出格式为名字,杀得人数,他被谁杀。";
ano();
ano();
cout<<"胜者:";
int pos=-1;
ano();
for(int i=1;i<=n;i++){
if(c[i].HP>0){
pos=c[i].idx;
break;
}
}
for(int i=1;i<=n;i++){
if(c[i].idx==pos){
color(c[i].idx);
cout<<(char)(c[i].idx+'A'-1)<<":";
cout<<c[i].name<<" "<<c[i].go_upper<<" "<<c[i].kill<<"\n";
}
}
ano();
ano();
color(0);
cout<<"败者:";
ano();
for(int i=1;i<=n;i++){
if(c[i].idx!=pos){
color(c[i].idx);
cout<<(char)(c[i].idx+'A'-1)<<":";
cout<<c[i].name<<" "<<c[i].go_upper<<" "<<c[i].kill<<"\n";
}
}
color(0);
return ;
}
int main(){
system("cls");
color(0);
system("cls");
MessageBox(NULL,"欢迎来到name-computation5.0_c++\n 官方正版。","name-computation",MB_OK);
MessageBox(NULL,"此版本修复了4.0版本中的多处bug,\n 给您带来更好的游戏体验。","name-computation",MB_OK);
MessageBox(NULL,"由于开发者正在开发另一款程序,所以本应用程序将暂缓更新","name-computation",MB_OK);
give_num_to_how_a_fine_work();
begin();
in();
fight_begin_out();
fight();
last_out();
return 0;
}
曹灿阳——扫雷
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <bits/stdc++.h>
#include <windows.h>
#include <fstream>
#include <iomanip>
#define INF 0x3f3f3f3f
#pragma GCC optimize(3)
using namespace std;
void color(int corcorcor){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),corcorcor+32);
}
const int dir[8][2]={{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1}};
int mmap[40][40],win,lose;
bool vis[40][40],fflag[40][40];
bool pd(int m,int n){
for(int i=1;i<=m;i++){
for(int j=1;j<=n;j++){
if(vis[i][j]==0&&mmap[i][j]!=INF)
return false;
}
}
return true;
}
bool valid(int x,int y,int m,int n){
if(x>=1&&x<=m&&y>=1&&y<=n)
return true;
return false;
}
void fankai(int x,int y,int m,int n){
for(int i=0;i<8;i++){
int nx=x+dir[i][0],ny=y+dir[i][1];
if(valid(nx,ny,m,n)&&vis[nx][ny]==0){
if(mmap[nx][ny]!=INF)
vis[nx][ny]=true;
if(mmap[nx][ny]==0)
fankai(nx,ny,m,n);
}
}
}
bool saolei_p1(int m,int n){
memset(vis,0,sizeof(vis));
memset(fflag,0,sizeof(fflag));
while(!pd(m,n)){
system("cls");
for(int i=1;i<=m;i++){
for(int j=1;j<=n;j++){
if(fflag[i][j]){
color(11);
cout<<"F ";
}
else if(vis[i][j]&&mmap[i][j]!=INF){
if(mmap[i][j]==0){
color(13);
}
else{
color(15);
}
cout<<mmap[i][j]<<" ";
}
else{
color(12);
cout<<"? ";
}
}
color(9);
cout<<left<<setw(2)<<i<<endl;
}
color(9);
for(int j=1;j<=n;j++)
cout<<left<<setw(2)<<j;
cout<<" ←列"<<endl;
cout<<right<<setw(n*2+2)<<" ↑"<<endl;
cout<<right<<setw(n*2+2)<<" 行"<<endl;
Sleep(1000);
color(14);
cout<<"输入说明:\n";
cout<<"先输入两个数,空格隔开,表示你要操作的坐标。\n";
cout<<"接着,输入一个数,表示操作类型:\n\t1表示翻开,\n\t2表示插旗,\n\t3表示快捷翻开周围的格子(前提是正确插旗)\n\t4表示撤销插旗\n\n\n";
int xa,xb,caozuo;
cin>>xa>>xb>>caozuo;
if(!valid(xa,xb,m,n)||(caozuo<1||caozuo>4)){
cout<<"输入错误,请重新输入!";
Sleep(1000);
system("cls");
continue;
}
if(caozuo==1){
if(mmap[xa][xb]==INF){
system("cls");
cout<<"你踩到地雷了!!!扫雷失败!!!\n这是答案:\n";
for(int i=1;i<=m;i++){
for(int j=1;j<=n;j++){
if(mmap[i][j]==INF){
color(11);
cout<<"* ";
}
else{
if(mmap[i][j]==0)
color(13);
else
color(15);
cout<<mmap[i][j]<<" ";
}
}
cout<<endl;
}
color(14);
system("pause");
return false;
}
vis[xa][xb]=true;
if(mmap[xa][xb]==0)
fankai(xa,xb,m,n);
}
if(caozuo==2){
if(vis[xa][xb]){
cout<<"操作失败!";
Sleep(1000);
system("cls");
continue;
}
fflag[xa][xb]=true;
}
if(caozuo==3){
if(!vis[xa][xb]){
cout<<"操作失败!";
Sleep(1000);
system("cls");
continue;
}
int cnt=0,tmp_flag=false;
for(int i=0;i<8;i++){
int nx=xa+dir[i][0],ny=xb+dir[i][1];
if(valid(nx,ny,m,n)&&fflag[nx][ny]){
cnt++;
if(mmap[nx][ny]!=INF){
tmp_flag=true;
}
}
}
if(cnt!=mmap[xa][xb]){
cout<<"操作格子周围的雷数不对,请注意。";
Sleep(1000);
system("cls");
continue;
}
else if(tmp_flag){
system("cls");
cout<<"插旗错误!!!扫雷失败!!!\n这是答案:\n";
for(int i=1;i<=m;i++){
for(int j=1;j<=n;j++){
if(mmap[i][j]==INF){
color(11);
cout<<"* ";
}
else{
if(mmap[i][j]==0)
color(13);
else
color(15);
cout<<mmap[i][j]<<" ";
}
}
cout<<endl;
}
color(14);
system("pause");
return false;
}
else{
for(int i=0;i<8;i++){
int nx=xa+dir[i][0],ny=xb+dir[i][1];
if(valid(nx,ny,m,n)&&mmap[nx][ny]!=INF){
vis[nx][ny]=true;
if(mmap[nx][ny]==0){
fankai(nx,ny,m,n);
}
}
}
}
}
if(caozuo==4){
if(fflag[xa][xb])
fflag[xa][xb]=false;
else{
cout<<"操作失败!";
Sleep(1000);
continue;
}
}
system("cls");
}
system("cls");
cout<<"你完成了扫雷,真厉害!\n这是答案:\n";
for(int i=1;i<=m;i++){
for(int j=1;j<=n;j++){
if(mmap[i][j]==INF){
color(11);
cout<<"* ";
}
else{
if(mmap[i][j]==0)
color(13);
else
color(15);
cout<<mmap[i][j]<<" ";
}
}
cout<<endl;
}
color(14);
system("pause");
system("cls");
return true;
}
bool saolei(int m,int n){
srand(time(NULL));
memset(mmap,0,sizeof(mmap));
memset(vis,0,sizeof(vis));
memset(fflag,0,sizeof(fflag));
system("cls");
int cnt_b=m*(n+1)/10+1;
for(int i=1;i<=cnt_b;i++){
int x=rand()%m+1,y=rand()%n+1;
mmap[x][y]=INF;
}
cnt_b=0;
for(int i=1;i<=m;i++){
for(int j=1;j<=n;j++){
if(mmap[i][j]==INF){
cnt_b++;
}
}
}
for(int i=1;i<=m;i++){
for(int j=1;j<=n;j++){
if(mmap[i][j]!=INF){
for(int k=0;k<8;k++){
int nx=i+dir[k][0],ny=j+dir[k][1];
if(valid(nx,ny,m,n)&&mmap[nx][ny]==INF){
mmap[i][j]++;
}
}
}
}
}
system("cls");
bool tmp=saolei_p1(m,n);
system("cls");
while(tmp==0){
lose++;
color(14);
bool a;
system("cls");
cout<<"是否重新开始相同的地图?(1表示是,0表示否)";
cin>>a;
if(a){
cout<<"好的,重新开始。";
system("cls");
tmp=saolei_p1(m,n);
}
else
break;
}
return tmp;
}
void goto_saolei(){
system("cls");
int m,n;
while(1){
cout<<"请输入你要玩多少行,多少列的扫雷?\n";
cin>>m>>n;
if(!(m>=3&&m<=30&&n>=3&&n<=30)){
cout<<"输入数据不合理,请重新输入!"<<endl;
Sleep(1000);
system("cls");
continue;
}
else{
break;
}
}
if(saolei(m,n))
win++;
system("cls");
}
int main(){
system("cls");
color(0);
system("cls");
color(14);
MessageBox(NULL,"欢迎来到扫雷1.2版(更上层楼)!\n特别鸣谢:沙宸安","欢迎",MB_OK);
MessageBox(NULL,"输入是核对一下,输入的内容不要有字母或者\n其他奇奇怪怪的东西,否则会让程序崩溃!!!","注意!",MB_OK);
system("cls");
bool cd;
cout<<"请问您是否使用上一次的存档???(输入1或0)";
cin>>cd;
if(cd){
cout<<"好的,恢复存档。"<<endl;
ifstream fin("扫雷.txt");
fin>>win>>lose;
fin.close();
Sleep(1000);
}
while(1){
system("cls");
cout<<"你要玩什么游戏?\n1. 扫雷\n输入-1退出游戏。\n其余在开发中,敬请期待!";
int g;
cin>>g;
if(g==-1)
break;
switch(g){
case 1:goto_saolei();break;
default:cout<<"输入错误,请重新输入!";Sleep(1000);continue;
}
}
system("cls");
bool bc;
cout<<"你赢了"<<win<<"局,输了"<<lose<<"局。成功率:";
printf("%.1f",win*100/(double)(win+lose));
cout<<"%\n";
Sleep(1500);
cout<<"是否保存???(输入1或0)";
cin>>bc;
if(bc){
cout<<"好的,保存后请立即退出。"<<endl;
ofstream fout("益智游戏大全.txt");
fout<<win<<" "<<lose;
fout.close();
Sleep(1000);
}
else{
system("cls");
cout<<"再见!!!";
ofstream fout("扫雷.txt");
fout<<0<<" "<<0;
fout.close();
Sleep(1000);
}
return 0;
}
火车模拟器
#include <bits/stdc++.h>
#include <windows.h>
using namespace std;
void color(int corcorcor,int corcorcor2){
corcorcor2*=16;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),corcorcor+corcorcor2);
}
string train[50][20]={
{
" ◢■■■■■■ ",
"◢■■和谐■■ ",
"◥■■■■■■ ",
"■◥■■■■■■■",
" ● ● "
}
,{
" ■■■■■■◣ ",
" ■■和谐■■◣",
" ■■■■■■◤",
"■■■■■■■◤■",
" ● ● "
},{
" ◢■■■■■■◣ ",
" ■■东风四号■■ ",
" ■■■■■■■■ ",
"■◥■■■■■■◤■",
" ● ● "
},{
" ◢■■■■■■◣ ",
"◢■■■和谐■■■◣",
"◥■■■■■■■■◤",
"■◥■■■■■■◤■",
" ● ● "
},{
" ",
" ■■■■■■ ",
" ■■■■■■ ",
"■■■■■■■■",
" ● ● "
},{
" ▄▄▄▄▄▄ ",
" ■‖■■‖■ ",
" ■‖■■‖■ ",
"■■■■■■■■",
" ● ● "
},{
" ■■■■■ ",
" ■■■■■ ",
" ■■■■■ ",
"■■■■■■■■■",
" ● ● "
},{
" ",
" ",
" ",
"■■■■■■■■■",
" ● ● "
},{
" ◢■■■■■■◣ ",
" ■■■■■■■■ ",
" ■■■■■■■■ ",
"■■■■■■■■■■",
" ● ● "
},{
" ◢■■■■■■◣ ",
" ■■■■■■■■ ",
" ■■■■■■■■ ",
"■■■■■■■■■■",
" ● ● "
},{
" ◢■■■■■■◣ ",
" ■■■■■■■■ ",
" ■■■■■■■■ ",
"■■■■■■■■■■",
" ● ● "
},{
" ◢■■■■■■◣ ",
" ■■■■■■■■ ",
" ■■■■■■■■ ",
"■■■■■■■■■■",
" ●◥■■◤● "
},{
" ◢■■■■◣ ",
" ■■■■■■ ",
" ◥‖■■‖◤ ",
"■■■■■■■■",
" ● ● ",
},{
" ■■■■■■■ ",
" ■■■■■■■ ",
" ■■■■■■■■ ",
"■■■■■■■■■■",
" ● ● "
},{
" ■■■■■■■ ",
" ■■■■■■■ ",
" ■■■■■■■■ ",
"■■■■■■■■■■",
" ● ● "
},{
" ◢■■■■■■◣ ",
"◢■■■和谐■■■◣",
"◥■■■■■■■■◤",
"■◥■■■■■■◤■",
" ● ● "
},{
" ◢■■■■◣ ",
" ■‖■■‖■ ",
" ■‖■■‖■ ",
"■■■■■■■■",
" ● ● "
},{
" ■■■■ ",
" ■■■■■■ ",
" ■■■■■■ ",
"■■■■■■■■",
" ● ● "
},{
" ◢■■■■◣ ",
" ■‖■■‖■ ",
" ■‖■■‖■ ",
"■■■■■■■■",
" ● ● "
},{
" ▄▄▄▄▄▄ ",
" ■‖■■‖■ ",
" ■‖■■‖■ ",
"■■■■■■■■",
" ● ● "
},{
" ▄▄▄▄▄▄ ",
" ■‖■■‖■ ",
" ■‖■■‖■ ",
"■■■■■■■■",
" ● ● "
},{
" ◢■■■■◣ ",
" ■‖■■‖■ ",
" ■‖■■‖■ ",
"■■■■■■■■",
" ● ● "
},{
" ",
" ■■■■■■ ",
" ■■■■■■ ",
"■■■■■■■■",
" ● ● "
},{
" ■■■■ ",
" ■■■■■■ ",
" ■■■■■■ ",
"■■■■■■■■",
" ● ● "
},{
" ■■■■ ",
" ■■■■■■ ",
" ■■■■■■ ",
"■■■■■■■■",
" ● ● "
},{
" ",
" ■■■■■■ ",
" ■■■■■■ ",
"■■■■■■■■",
" ● ● "
},{
" ■■■■■ ",
" ■■■■■ ",
" ■■■■■ ",
"■■■■■■■■■",
" ● ● "
},{
" ",
" ",
" ",
"■■■■■■■■■",
" ● ● "
},{
" ◢■■■■■■ ■■■■■■◣ ",
"◢■■■和谐■■--■■和谐■■■◣",
"◥■■■■■■■--■■■■■■■◤",
"■◥■■■■■■ ■■■■■■◤■",
" ● ● ● ● "
},{
" ◢■■■■■■ ■■■■■■◣ ",
"◢■■■和谐■■--■■和谐■■■◣",
"◥■■■■■■■--■■■■■■■◤",
"■◥■■■■■■ ■■■■■■◤■",
" ● ● ● ● "
}
};
int col[50][10][20]={
{//第一个
{15,2,2,2,2,2,2,2,15},
{2,2,2,4,4,2,2,15,15},
{2,2,2,2,2,2,2,15,15},
{0,2,2,2,2,2,2,2,0},
{15,15,8,15,15,15,8,15,15}
}
,{//第二个
{15,2,2,2,2,2,2,2,15},
{15,15,2,2,4,4,2,2,2},
{15,15,2,2,2,2,2,2,2},
{0,2,2,2,2,2,2,2,0},
{15,15,8,15,15,15,8,15,15}
},{//第三个
{15,10,10,10,10,10,10,10,10,15},
{15,10,10,2,2,2,2,10,10,15},
{15,10,10,10,10,10,10,10,10,15},
{0,10,10,10,10,10,10,10,10,0},
{15,15,8,15,15,15,15,8,15,15},
},{//第四个
{15,1,1,1,1,1,1,1,1,15},
{1,1,1,1,4,4,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1},
{0,1,1,1,1,1,1,1,1,0},
{15,15,8,15,15,15,15,8,15,15},
},{//第五个
{15,15,15,15,15,15,15,15},
{15,0,0,0,0,0,0,15},
{15,0,0,0,0,0,0,15},
{0,0,0,0,0,0,0,0},
{15,15,8,15,15,8,15,15}
},{//第六个
{15,0,0,0,0,0,0,15},
{15,0,0,0,0,0,0,15},
{15,0,0,0,0,0,0,15},
{0,0,0,0,0,0,0,0},
{15,15,8,15,15,8,15,15}
},{//第七个
{15,15,1,1,1,1,1,15,15},
{15,15,1,1,1,1,1,15,15},
{15,15,1,1,1,1,1,15,15},
{0,4,4,4,4,4,4,4,0},
{15,15,8,15,15,15,8,15,15}
},{//第八个
{15,15,15,15,15,15,15,15,15},
{15,15,15,15,15,15,15,15,15},
{15,15,15,15,15,15,15,15,15},
{0,4,4,4,4,4,4,4,0},
{15,15,8,15,15,15,8,15,15}
},{//第九个
{15,2,2,2,2,2,2,2,2,15},
{15,2,8,8,2,2,8,8,2,15},
{15,2,2,2,2,2,2,2,2,15},
{0,2,2,2,2,2,2,2,2,0},
{15,15,8,15,15,15,15,8,15,15}
},{//第十个
{15,12,12,12,12,12,12,12,12,15},
{15,12,8,8,12,12,8,8,12,15},
{15,12,12,12,12,12,12,12,12,15},
{0,12,12,12,12,12,12,12,12,0},
{15,15,8,15,15,15,15,8,15,15}
},{//第十一个
{15,1,1,1,1,1,1,1,1,15},
{15,1,8,8,1,1,8,8,1,15},
{15,1,1,1,1,1,1,1,1,15},
{0,1,1,1,1,1,1,1,1,0},
{15,15,8,15,15,15,15,8,15,15}
},{//第十二个
{15,12,12,12,12,12,12,12,12,15},
{15,12,12,12,12,12,12,12,12,15},
{15,12,12,12,12,12,12,12,12,15},
{0,12,12,12,12,12,12,12,12,0},
{15,15,8,12,12,12,12,8,15,15}
},{//第十三个
{15,6,6,6,6,6,6,15},
{15,6,6,6,6,6,6,15},
{15,6,0,6,6,0,6,15},
{0,0,0,0,0,0,0,0},
{15,15,8,15,15,8,15,15}
},{//第十四个
{15,3,3,3,3,3,3,3,15,15},
{15,3,3,3,3,3,0,3,15,15},
{15,3,3,3,3,3,3,3,3,15},
{0,3,3,3,3,3,3,3,3,0},
{15,15,8,15,15,15,8,15,15,15}
},{
{15,15,3,3,3,3,3,3,3,15},
{15,15,3,0,3,3,3,3,3,15},
{15,3,3,3,3,3,3,3,3,15},
{0,3,3,3,3,3,3,3,3,0},
{15,15,15,8,15,15,15,8,15,15}
},{
{15,2,2,2,2,2,2,2,2,15},
{2,2,2,2,4,4,2,2,2,2},
{2,2,2,2,2,2,2,2,2,2},
{0,2,2,2,2,2,2,2,2,0},
{15,15,8,15,15,15,15,8,15,15},
},{
{15,0,0,0,0,0,0,15},
{15,0,0,0,0,0,0,15},
{15,0,0,0,0,0,0,15},
{0,0,0,0,0,0,0,0},
{15,15,8,15,15,8,15,15}
},{
{15,15,1,1,1,1,15,15},
{15,0,0,0,0,0,0,15},
{15,0,0,0,0,0,0,15},
{0,0,0,0,0,0,0,0},
{15,15,8,15,15,8,15,15}
},{
{15,2,2,2,2,2,2,15},
{15,2,2,2,2,2,2,15},
{15,2,2,2,2,2,2,15},
{0,2,2,2,2,2,2,0},
{15,15,8,15,15,8,15,15}
},{
{15,2,2,2,2,2,2,15},
{15,2,2,2,2,2,2,15},
{15,2,2,2,2,2,2,15},
{0,2,2,2,2,2,2,0},
{15,15,8,15,15,8,15,15}
},{
{15,4,4,4,4,4,4,15},
{15,4,4,4,4,4,4,15},
{15,4,4,4,4,4,4,15},
{0,4,4,4,4,4,4,0},
{15,15,8,15,15,8,15,15}
},{
{15,4,4,4,4,4,4,15},
{15,4,4,4,4,4,4,15},
{15,4,4,4,4,4,4,15},
{0,4,4,4,4,4,4,0},
{15,15,8,15,15,8,15,15}
},{
{15,15,15,15,15,15,15,15},
{15,4,4,4,4,4,4,15},
{15,4,4,4,4,4,4,15},
{0,4,4,4,4,4,4,0},
{15,15,8,15,15,8,15,15}
},{
{15,15,1,1,1,1,15,15},
{15,4,4,4,4,4,4,15},
{15,4,4,4,4,4,4,15},
{0,4,4,4,4,4,4,0},
{15,15,8,15,15,8,15,15}
},{
{15,15,1,1,1,1,15,15},
{15,2,2,2,2,2,2,15},
{15,2,2,2,2,2,2,15},
{0,2,2,2,2,2,2,0},
{15,15,8,15,15,8,15,15}
},{
{15,15,15,15,15,15,15,15},
{15,2,2,2,2,2,2,15},
{15,2,2,2,2,2,2,15},
{0,2,2,2,2,2,2,0},
{15,15,8,15,15,8,15,15}
},{
{15,15,1,1,1,1,1,15,15},
{15,15,1,1,1,1,1,15,15},
{15,15,1,1,1,1,1,15,15},
{0,0,0,0,0,0,0,0,0},
{15,15,8,15,15,15,8,15,15}
},{
{15,15,15,15,15,15,15,15,15},
{15,15,15,15,15,15,15,15,15},
{15,15,15,15,15,15,15,15,15},
{0,0,0,0,0,0,0,0,0},
{15,15,8,15,15,15,8,15,15}
},{
{15,1,1,1,1,1,1,1,15,1,1,1,1,1,1,1,15},
{1,1,1,1,4,4,1,1,0,1,1,4,4,1,1,1,1},
{1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1},
{0,1,1,1,1,1,1,1,15,1,1,1,1,1,1,1,0},
{15,15,8,15,15,15,8,15,15,15,8,15,15,15,8,15,15}
},{
{15,2,2,2,2,2,2,2,15,2,2,2,2,2,2,2,15},
{2,2,2,2,4,4,2,2,0,2,2,4,4,2,2,2,2},
{2,2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,2},
{0,2,2,2,2,2,2,2,15,2,2,2,2,2,2,2,0},
{15,15,8,15,15,15,8,15,15,15,8,15,15,15,8,15,15}
}
};
int len[50]={9,9,10,10,8,8,9,9,10,10,10,10,8,10,10,10,8,8,8,8,8,8,8,8,8,8,9,9,17,17};
int way,cx[10010],co[10][1000010];
string str[10],tmp[10];
int main(){
system("cls");
color(0,15);
system("cls");
printf("\n\n\n\t\t\t\t");
color(4,15);
cout<<"火";
Sleep(1000);
system("cls");
printf("\n\n\n\t\t\t\t");
color(1,15);
cout<<"火";
color(4,15);
cout<<"车";
Sleep(1000);
system("cls");
printf("\n\n\n\t\t\t\t");
color(1,15);
cout<<"火车";
color(4,15);
cout<<"模";
Sleep(1000);
system("cls");
printf("\n\n\n\t\t\t\t");
color(1,15);
cout<<"火车模";
color(4,15);
cout<<"拟";
Sleep(1000);
system("cls");
printf("\n\n\n\t\t\t\t");
color(1,15);
cout<<"火车模拟";
color(4,15);
cout<<"器";
Sleep(1000);
system("cls");
color(1,15);
printf("\n\n\n\t\t\t\t");
cout<<"火车模拟器";
Sleep(1000);
color(0,15);
cout<<"\n\n\t\t\t";
printf("曹灿阳原创,请勿抄袭!!!");
Sleep(2000);
system("cls");
while(1){
memset(cx,0,sizeof(cx));
memset(co,0,sizeof(co));
for(int i=0;i<10;i++){
str[i]="";
tmp[i]="";
}
system("cls");
color(0,15);
system("cls");
color(0,15);
printf("请输入火车的方向:(0表示从左往右,非0表示从右往左,Ctrl+C退出)");
cin>>way;
if(way!=0)
way=1;
for(int i=0;i<30;i++){
for(int j=0;j<5;j++){
for(int k=0;k<train[i][j].size();k+=2){
color(col[i][j][k/2],15);
printf("%c%c",train[i][j][k],train[i][j][k+1]);
}
printf("\n");
}
color(0,15);
printf("第%d号车厢(包括火车头)\n\n",i);
}
color(0,15);
printf("请输入火车车厢编号(车厢数不多于10000,多余的部分自动省略,\n从左到右依次为车厢从左到右的顺序),\n空格隔开,异常值不读,按-1结束输入。\n");
int idx=1;
while(1){
cin>>cx[idx];
if(cx[idx]==-1||cx[idx]==10000)
break;
if(cx[idx]>=30||cx[idx]<0){
continue;
}
idx++;
}
idx--;
if(idx==0){
color(0,15);
cout<<"一节车厢也没有,你在输入空气???";
Sleep(1000);
continue;
}
int l=0;
for(int i=1;i<=idx;i++){
for(int k=0;k<len[cx[i]];k++){
for(int j=0;j<5;j++){
co[j][l]=col[cx[i]][j][k];
}
l++;
}
for(int j=0;j<5;j++){
str[j]+=train[cx[i]][j];
}
}
l--;
system("cls");
color(0,15);
system("cls");
if(way==0){
cout<<(char)7;
for(int i=l;i>=0;i--){
printf("\n\n\n\n\n\n\n\n\n\n");
for(int j=0;j<5;j++){
//str[j].substr(max(i,0)*2,(min(i+38,l)-i+1)*2);
for(int k=max(i,0)*2;k<=min(i+38,l)*2;k+=2){
color(co[j][k/2],15);
//cout<<;
cout<<str[j].substr(k,2);
}
printf("\n");
}
color(0,15);
printf("〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓");
Sleep(75);
system("cls");
}
string kongge="";
for(int i=1;i<=38;i++){
printf("\n\n\n\n\n\n\n\n\n\n");
kongge+=" ";
for(int j=0;j<5;j++){
cout<<kongge;
for(int k=0;k<=min((38-i)*2,l*2);k+=2){
color(co[j][k/2],15);
cout<<str[j].substr(k,2);
}
printf("\n");
}
color(0,15);
printf("〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓");
Sleep(75);
system("cls");
}
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓");
cout<<(char)7;
Sleep(1000);
system("cls");
}else{
cout<<(char)7;
for(int i=38;i>=0;i--){
printf("\n\n\n\n\n\n\n\n\n\n");
for(int j=0;j<5;j++){
for(int k=1;k<=i;k++)
cout<<" ";
for(int k=0;k<=min(l,38-i)*2;k+=2){
color(co[j][k/2],15);
cout<<str[j].substr(k,2);
}
printf("\n");
}
color(0,15);
printf("〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓");
Sleep(75);
system("cls");
}
for(int i=1;i<=l;i++){
printf("\n\n\n\n\n\n\n\n\n\n");
//左:i 右:min(l,i+38)
for(int j=0;j<5;j++){
for(int k=i*2;k<=min(38+i,l)*2;k+=2){
color(co[j][k/2],15);
cout<<str[j].substr(k,2);
}
printf("\n");
}
color(0,15);
printf("〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓");
Sleep(75);
system("cls");
}
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓");
cout<<(char)7;
Sleep(1000);
system("cls");
color(0,15);
system("cls");
}
}
return 0;
}
曹灿阳在2021-02-26 22:16:12追加了内容
整改内容
NC5.0:使游戏适应Windows7系统
扫雷:修改已知bug,调整背景颜色
火车模拟器:增加车厢种类,优化模拟界面
曹灿阳在2021-02-28 18:10:02追加了内容
火车模拟器更新:
#include <bits/stdc++.h>
#include <windows.h>
#include<conio.h>
#include<time.h>
using namespace std;
void color(int corcorcor,int corcorcor2){
corcorcor2*=16;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),corcorcor+corcorcor2);
}
string train[50][20]={
{
" ◢■■■■■■ ",
"◢■■和谐■■ ",
"◥■■■■■■ ",
"■◥■■■■■■■",
" ● ● "
}
,{
" ■■■■■■◣ ",
" ■■和谐■■◣",
" ■■■■■■◤",
"■■■■■■■◤■",
" ● ● "
},{
" ◢■■■■■■◣ ",
" ■■东风四号■■ ",
" ■■■■■■■■ ",
"■◥■■■■■■◤■",
" ● ● "
},{
" ◢■■■■■■◣ ",
"◢■■■和谐■■■◣",
"◥■■■■■■■■◤",
"■◥■■■■■■◤■",
" ● ● "
},{
" ",
" ■■■■■■ ",
" ■■■■■■ ",
"■■■■■■■■",
" ● ● "
},{
" ▄▄▄▄▄▄ ",
" ■‖■■‖■ ",
" ■‖■■‖■ ",
"■■■■■■■■",
" ● ● "
},{
" ■■■■■ ",
" ■■■■■ ",
" ■■■■■ ",
"■■■■■■■■■",
" ● ● "
},{
" ",
" ",
" ",
"■■■■■■■■■",
" ● ● "
},{
" ◢■■■■■■◣ ",
" ■■■■■■■■ ",
" ■■■■■■■■ ",
"■■■■■■■■■■",
" ● ● "
},{
" ◢■■■■■■◣ ",
" ■■■■■■■■ ",
" ■■■■■■■■ ",
"■■■■■■■■■■",
" ● ● "
},{
" ◢■■■■■■◣ ",
" ■■■■■■■■ ",
" ■■■■■■■■ ",
"■■■■■■■■■■",
" ● ● "
},{
" ◢■■■■■■◣ ",
" ■■■■■■■■ ",
" ■■■■■■■■ ",
"■■■■■■■■■■",
" ●◥■■◤● "
},{
" ◢■■■■◣ ",
" ■■■■■■ ",
" ◥‖■■‖◤ ",
"■■■■■■■■",
" ● ● "
},{
" ■■■■■■■ ",
" ■■■■■■■ ",
" ■■■■■■■■ ",
"■■■■■■■■■■",
" ● ● "
},{
" ■■■■■■■ ",
" ■■■■■■■ ",
" ■■■■■■■■ ",
"■■■■■■■■■■",
" ● ● "
},{
" ◢■■■■■■◣ ",
"◢■■■和谐■■■◣",
"◥■■■■■■■■◤",
"■◥■■■■■■◤■",
" ● ● "
},{
" ◢■■■■◣ ",
" ■‖■■‖■ ",
" ■‖■■‖■ ",
"■■■■■■■■",
" ● ● "
},{
" ■■■■ ",
" ■■■■■■ ",
" ■■■■■■ ",
"■■■■■■■■",
" ● ● "
},{
" ◢■■■■◣ ",
" ■‖■■‖■ ",
" ■‖■■‖■ ",
"■■■■■■■■",
" ● ● "
},{
" ▄▄▄▄▄▄ ",
" ■‖■■‖■ ",
" ■‖■■‖■ ",
"■■■■■■■■",
" ● ● "
},{
" ▄▄▄▄▄▄ ",
" ■‖■■‖■ ",
" ■‖■■‖■ ",
"■■■■■■■■",
" ● ● "
},{
" ◢■■■■◣ ",
" ■‖■■‖■ ",
" ■‖■■‖■ ",
"■■■■■■■■",
" ● ● "
},{
" ",
" ■■■■■■ ",
" ■■■■■■ ",
"■■■■■■■■",
" ● ● "
},{
" ■■■■ ",
" ■■■■■■ ",
" ■■■■■■ ",
"■■■■■■■■",
" ● ● "
},{
" ■■■■ ",
" ■■■■■■ ",
" ■■■■■■ ",
"■■■■■■■■",
" ● ● "
},{
" ",
" ■■■■■■ ",
" ■■■■■■ ",
"■■■■■■■■",
" ● ● "
},{
" ■■■■■ ",
" ■■■■■ ",
" ■■■■■ ",
"■■■■■■■■■",
" ● ● "
},{
" ",
" ",
" ",
"■■■■■■■■■",
" ● ● "
},{
" ◢■■■■■■ ■■■■■■◣ ",
"◢■■和谐■■■--■■■和谐■■◣",
"◥■■■■■■■--■■■■■■■◤",
"■◥■■■■■■ ■■■■■■◤■",
" ● ● ● ● "
},{
" ◢■■■■■■ ■■■■■■◣ ",
"◢■■和谐■■■--■■■和谐■■◣",
"◥■■■■■■■--■■■■■■■◤",
"■◥■■■■■■ ■■■■■■◤■",
" ● ● ● ● "
},{
" ◢■■■■■■◣ ",
" ■快速铁路运输■ ",
" ■■■■■■■■ ",
"■■■■■■■■■■",
" ● ● "
},{
" ■■■■■■ ",
" ■■■■■■ ",
" ◥■■■■◤ ",
"■■■■■■■■",
" ● ● "
},{
" ◢■■■■◣ ",
" ■■■■■■ ",
" ◥‖■■‖◤ ",
"■■■■■■■■",
" ● ● "
},{
" ◢■■■■■■◣ ",
" ■■■■■■■■ ",
" ■■■■■■■■ ",
"■■■■■■■■■■",
" ● ● "
},{
" ■■■■■■ ",
" ‖■■■■■■‖ ",
" ■■■■■■■■ ",
"■■■■■■■■■■",
" ● ● "
}
};
int col[50][10][20]={
{//第一个
{15,2,2,2,2,2,2,2,15},
{2,2,2,4,4,2,2,15,15},
{2,2,2,2,2,2,2,15,15},
{0,2,2,2,2,2,2,2,0},
{15,15,8,15,15,15,8,15,15}
}
,{//第二个
{15,2,2,2,2,2,2,2,15},
{15,15,2,2,4,4,2,2,2},
{15,15,2,2,2,2,2,2,2},
{0,2,2,2,2,2,2,2,0},
{15,15,8,15,15,15,8,15,15}
},{//第三个
{15,10,10,10,10,10,10,10,10,15},
{15,10,10,2,2,2,2,10,10,15},
{15,10,10,10,10,10,10,10,10,15},
{0,10,10,10,10,10,10,10,10,0},
{15,15,8,15,15,15,15,8,15,15},
},{//第四个
{15,1,1,1,1,1,1,1,1,15},
{1,1,1,1,4,4,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1},
{0,1,1,1,1,1,1,1,1,0},
{15,15,8,15,15,15,15,8,15,15},
},{//第五个
{15,15,15,15,15,15,15,15},
{15,0,0,0,0,0,0,15},
{15,0,0,0,0,0,0,15},
{0,0,0,0,0,0,0,0},
{15,15,8,15,15,8,15,15}
},{//第六个
{15,0,0,0,0,0,0,15},
{15,0,0,0,0,0,0,15},
{15,0,0,0,0,0,0,15},
{0,0,0,0,0,0,0,0},
{15,15,8,15,15,8,15,15}
},{//第七个
{15,15,1,1,1,1,1,15,15},
{15,15,1,1,1,1,1,15,15},
{15,15,1,1,1,1,1,15,15},
{0,4,4,4,4,4,4,4,0},
{15,15,8,15,15,15,8,15,15}
},{//第八个
{15,15,15,15,15,15,15,15,15},
{15,15,15,15,15,15,15,15,15},
{15,15,15,15,15,15,15,15,15},
{0,4,4,4,4,4,4,4,0},
{15,15,8,15,15,15,8,15,15}
},{//第九个
{15,2,2,2,2,2,2,2,2,15},
{15,2,8,8,2,2,8,8,2,15},
{15,2,2,2,2,2,2,2,2,15},
{0,2,2,2,2,2,2,2,2,0},
{15,15,8,15,15,15,15,8,15,15}
},{//第十个
{15,12,12,12,12,12,12,12,12,15},
{15,12,8,8,12,12,8,8,12,15},
{15,12,12,12,12,12,12,12,12,15},
{0,12,12,12,12,12,12,12,12,0},
{15,15,8,15,15,15,15,8,15,15}
},{//第十一个
{15,1,1,1,1,1,1,1,1,15},
{15,1,8,8,1,1,8,8,1,15},
{15,1,1,1,1,1,1,1,1,15},
{0,1,1,1,1,1,1,1,1,0},
{15,15,8,15,15,15,15,8,15,15}
},{//第十二个
{15,12,12,12,12,12,12,12,12,15},
{15,12,12,12,12,12,12,12,12,15},
{15,12,12,12,12,12,12,12,12,15},
{0,12,12,12,12,12,12,12,12,0},
{15,15,8,12,12,12,12,8,15,15}
},{//第十三个
{15,6,6,6,6,6,6,15},
{15,6,6,6,6,6,6,15},
{15,6,0,6,6,0,6,15},
{0,0,0,0,0,0,0,0},
{15,15,8,15,15,8,15,15}
},{//第十四个
{15,3,3,3,3,3,3,3,15,15},
{15,3,3,3,3,3,0,3,15,15},
{15,3,3,3,3,3,3,3,3,15},
{0,3,3,3,3,3,3,3,3,0},
{15,15,8,15,15,15,8,15,15,15}
},{
{15,15,3,3,3,3,3,3,3,15},
{15,15,3,0,3,3,3,3,3,15},
{15,3,3,3,3,3,3,3,3,15},
{0,3,3,3,3,3,3,3,3,0},
{15,15,15,8,15,15,15,8,15,15}
},{
{15,2,2,2,2,2,2,2,2,15},
{2,2,2,2,4,4,2,2,2,2},
{2,2,2,2,2,2,2,2,2,2},
{0,2,2,2,2,2,2,2,2,0},
{15,15,8,15,15,15,15,8,15,15},
},{
{15,0,0,0,0,0,0,15},
{15,0,0,0,0,0,0,15},
{15,0,0,0,0,0,0,15},
{0,0,0,0,0,0,0,0},
{15,15,8,15,15,8,15,15}
},{
{15,15,1,1,1,1,15,15},
{15,0,0,0,0,0,0,15},
{15,0,0,0,0,0,0,15},
{0,0,0,0,0,0,0,0},
{15,15,8,15,15,8,15,15}
},{
{15,2,2,2,2,2,2,15},
{15,2,2,2,2,2,2,15},
{15,2,2,2,2,2,2,15},
{0,2,2,2,2,2,2,0},
{15,15,8,15,15,8,15,15}
},{
{15,2,2,2,2,2,2,15},
{15,2,2,2,2,2,2,15},
{15,2,2,2,2,2,2,15},
{0,2,2,2,2,2,2,0},
{15,15,8,15,15,8,15,15}
},{
{15,4,4,4,4,4,4,15},
{15,4,4,4,4,4,4,15},
{15,4,4,4,4,4,4,15},
{0,4,4,4,4,4,4,0},
{15,15,8,15,15,8,15,15}
},{
{15,4,4,4,4,4,4,15},
{15,4,4,4,4,4,4,15},
{15,4,4,4,4,4,4,15},
{0,4,4,4,4,4,4,0},
{15,15,8,15,15,8,15,15}
},{
{15,15,15,15,15,15,15,15},
{15,4,4,4,4,4,4,15},
{15,4,4,4,4,4,4,15},
{0,4,4,4,4,4,4,0},
{15,15,8,15,15,8,15,15}
},{
{15,15,1,1,1,1,15,15},
{15,4,4,4,4,4,4,15},
{15,4,4,4,4,4,4,15},
{0,4,4,4,4,4,4,0},
{15,15,8,15,15,8,15,15}
},{
{15,15,1,1,1,1,15,15},
{15,2,2,2,2,2,2,15},
{15,2,2,2,2,2,2,15},
{0,2,2,2,2,2,2,0},
{15,15,8,15,15,8,15,15}
},{
{15,15,15,15,15,15,15,15},
{15,2,2,2,2,2,2,15},
{15,2,2,2,2,2,2,15},
{0,2,2,2,2,2,2,0},
{15,15,8,15,15,8,15,15}
},{
{15,15,1,1,1,1,1,15,15},
{15,15,1,1,1,1,1,15,15},
{15,15,1,1,1,1,1,15,15},
{0,0,0,0,0,0,0,0,0},
{15,15,8,15,15,15,8,15,15}
},{
{15,15,15,15,15,15,15,15,15},
{15,15,15,15,15,15,15,15,15},
{15,15,15,15,15,15,15,15,15},
{0,0,0,0,0,0,0,0,0},
{15,15,8,15,15,15,8,15,15}
},{
{15,1,1,1,1,1,1,1,15,1,1,1,1,1,1,1,15},
{1,1,1,4,4,1,1,1,0,1,1,1,4,4,1,1,1},
{1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1},
{0,1,1,1,1,1,1,1,15,1,1,1,1,1,1,1,0},
{15,15,8,15,15,15,8,15,15,15,8,15,15,15,8,15,15}
},{
{15,2,2,2,2,2,2,2,15,2,2,2,2,2,2,2,15},
{2,2,2,4,4,2,2,2,0,2,2,2,4,4,2,2,2},
{2,2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,2},
{0,2,2,2,2,2,2,2,15,2,2,2,2,2,2,2,0},
{15,15,8,15,15,15,8,15,15,15,8,15,15,15,8,15,15}
},{
{15,12,12,12,12,12,12,12,12,15},
{15,12,4,4,4,4,4,4,12,15},
{15,12,12,12,12,12,12,12,12,15},
{0,12,12,12,12,12,12,12,12,0},
{15,15,8,15,15,15,15,8,15,15}
},{
{15,8,8,8,8,8,8,15},
{15,8,8,8,8,8,8,15},
{15,8,8,8,8,8,8,15},
{0,0,0,0,0,0,0,0},
{15,15,8,15,15,8,15,15}
},{
{15,8,8,8,8,8,8,15},
{15,8,8,8,8,8,8,15},
{15,8,0,8,8,0,8,15},
{0,0,0,0,0,0,0,0},
{15,15,8,15,15,8,15,15}
},{
{15,6,6,6,6,6,6,6,6,15},
{15,6,6,6,6,6,6,6,6,15},
{15,6,6,6,6,6,6,6,6,15},
{0,6,6,6,6,6,6,6,6,0},
{15,15,8,15,15,15,15,8,15,15}
},{
{15,15,4,4,4,4,4,4,15,15},
{15,0,4,4,4,4,4,4,0,15},
{15,4,4,4,4,4,4,4,4,15},
{0,4,4,4,4,4,4,4,4,0},
{15,15,8,15,15,15,15,8,15,15}
}
};
int len[50]={9,9,10,10,8,8,9,9,10,10,10,10,8,10,10,10,8,8,8,8,8,8,8,8,8,8,9,9,17,17,10,8,8,10,10};
int way,cx[10010],co[10][1000010];
string str[10],tmp[10];
int main(){
//HideCursor();
system("cls");
color(0,15);
system("cls");
printf("\n\n\n\t\t\t\t");
color(4,15);
cout<<"火";
Sleep(1000);
system("cls");
printf("\n\n\n\t\t\t\t");
color(1,15);
cout<<"火";
color(4,15);
cout<<"车";
Sleep(1000);
system("cls");
printf("\n\n\n\t\t\t\t");
color(1,15);
cout<<"火车";
color(4,15);
cout<<"模";
Sleep(1000);
system("cls");
printf("\n\n\n\t\t\t\t");
color(1,15);
cout<<"火车模";
color(4,15);
cout<<"拟";
Sleep(1000);
system("cls");
printf("\n\n\n\t\t\t\t");
color(1,15);
cout<<"火车模拟";
color(4,15);
cout<<"器";
Sleep(1000);
system("cls");
color(1,15);
printf("\n\n\n\t\t\t\t");
cout<<"火车模拟器";
Sleep(1000);
color(0,15);
cout<<"\n\n\t\t\t";
printf("曹灿阳原创,请勿抄袭!!!");
Sleep(2000);
system("cls");
while(1){
memset(cx,0,sizeof(cx));
memset(co,0,sizeof(co));
for(int i=0;i<10;i++){
str[i]="";
tmp[i]="";
}
system("cls");
color(0,15);
system("cls");
color(0,15);
printf("请输入火车的方向:(0表示从左往右,非0表示从右往左,Ctrl+C退出)");
cin>>way;
if(way!=0)
way=1;
for(int i=0;i<35;i++){
for(int j=0;j<5;j++){
for(int k=0;k<train[i][j].size();k+=2){
color(col[i][j][k/2],15);
printf("%c%c",train[i][j][k],train[i][j][k+1]);
}
printf("\n");
}
color(0,15);
printf("第%d号车厢(包括火车头)\n\n",i);
}
color(0,15);
printf("请输入火车车厢编号(车厢数不多于10000,多余的部分自动省略,\n从左到右依次为车厢从左到右的顺序),\n空格隔开,异常值不读,按-1结束输入。\n");
int idx=1;
while(1){
cin>>cx[idx];
if(cx[idx]==-1||idx==10000)
break;
if(cx[idx]>=35||cx[idx]<0){
continue;
}
idx++;
}
idx--;
if(idx==0){
color(0,15);
cout<<"一节车厢也没有,你在输入空气???";
Sleep(1000);
continue;
}
int l=0;
for(int i=1;i<=idx;i++){
for(int k=0;k<len[cx[i]];k++){
for(int j=0;j<5;j++){
co[j][l]=col[cx[i]][j][k];
}
l++;
}
for(int j=0;j<5;j++){
str[j]+=train[cx[i]][j];
}
}
l--;
system("cls");
color(0,15);
system("cls");
if(way==0){
cout<<(char)7;
for(int i=l;i>=0;i--){
printf("\n\n\n\n\n\n\n\n\n\n");
for(int j=0;j<5;j++){
//str[j].substr(max(i,0)*2,(min(i+38,l)-i+1)*2);
for(int k=max(i,0)*2;k<=min(i+38,l)*2;k+=2){
color(co[j][k/2],15);
//cout<<;
cout<<str[j].substr(k,2);
}
printf("\n");
}
color(0,15);
printf("〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓");
Sleep(75);
system("cls");
}
string kongge="";
for(int i=1;i<=38;i++){
printf("\n\n\n\n\n\n\n\n\n\n");
kongge+=" ";
for(int j=0;j<5;j++){
cout<<kongge;
for(int k=0;k<=min((38-i)*2,l*2);k+=2){
color(co[j][k/2],15);
cout<<str[j].substr(k,2);
}
printf("\n");
}
color(0,15);
printf("〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓");
Sleep(75);
system("cls");
}
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓");
cout<<(char)7;
Sleep(1000);
system("cls");
}else{
cout<<(char)7;
for(int i=38;i>=0;i--){
printf("\n\n\n\n\n\n\n\n\n\n");
for(int j=0;j<5;j++){
for(int k=1;k<=i;k++)
cout<<" ";
for(int k=0;k<=min(l,38-i)*2;k+=2){
color(co[j][k/2],15);
cout<<str[j].substr(k,2);
}
printf("\n");
}
color(0,15);
printf("〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓");
Sleep(75);
system("cls");
}
for(int i=1;i<=l;i++){
printf("\n\n\n\n\n\n\n\n\n\n");
//左:i 右:min(l,i+38)
for(int j=0;j<5;j++){
for(int k=i*2;k<=min(38+i,l)*2;k+=2){
color(co[j][k/2],15);
cout<<str[j].substr(k,2);
}
printf("\n");
}
color(0,15);
printf("〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓");
Sleep(75);
system("cls");
}
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓");
cout<<(char)7;
Sleep(1000);
system("cls");
color(0,15);
system("cls");
}
}
return 0;
}
0
2
1
0
0
张帆
中级天翼
中级天翼
@曹灿阳
李志远这些天给我一个名字竞技场代码
是我的改版,但是奇怪的是我刚把他的代码按我的代码套入tiger系统的流程套入tiger系统
一运行就报错,不知咋地,
不过他的代码单独运行的效果挺好的,
缺少兼容性。
0
0
0
0
0