devc++跑酷小游戏3.5.0

news/2024/4/19 16:06:35

 本来想搞存档的,失败了,要再学学文件操作的函数。还有一个打印地图的函数,更失败,彻底放弃。最近开学了,游戏不会经常更新,要写作业。昨天写到10点T_T

#include<bits/stdc++.h>
#include<windows.h>
#include<conio.h>
#include<cstdio>
using namespace std;
int a,a1,b,b1,gb,c,d;
int cd1,cd2,tc;
int ax;
int dan=0;
char rw='@';
string mapp1[6][25]={{"                                                 ","                                                 ","    ------------------------------------------   ","                                                 ","                                                 ","                                                 ","                                                 ","   =                                             ","                                                 ","                                                 ","                                                 ","                                                 ","                                                 ","         =----  --  -- - -----                   ","    =                                            ","---- --                                          ","                               ^                 ","                                                 ","                                                 ","----^--=                                         ","                                   ---=          ","                                                 ","                                              |- ",	"                                               $ ","                                             ----",},{"                                                 ","                                                 ","                                                 ","                                                 ","                                                 ","                                                 ","                                                 ","                                                 ","                                                 ","                                                 ","                               ==^               ","                                      -  --^     ","                                                 ","                                                 ","                                                 ","                                                 ","                                                 ","                              ==^                ","              --- <                              ","               <                                 ","            ---                                  ", "          --                                 <^ ^","       --                                    <  |","--^ ----               -                      ^ $", "                         ----=                >--",},{"                                                 ","                                                 ","                                                 ","                                                 ","                                                 ","                                                 ","                                                 ","                                                 ","                                                 ","                                                 ","    ==-                                          ","           ^===^    > <    -                     ","           <    > >    <                         ","                  >    <                         ","                       <                         ","                                                 ","           -----                                 ","  ==                                             ","                                                ^","                -=-=-==----                     $","                                              ^--","                                              <  ", "             ===                                 ","                                    >     <      ", "-==                                  ^---^  ==   ", },{"                                                 ","                                                 ","                                                 ","                                                 ","                              ------        ---  ","                             -       ---  --   ^ ","                       <--->                     ","    <->             --                        <^ ","                  --                           <$","  =^    <->                                     <"," =            ---^                               ","                                  ^              ","                                  |              ","                                 <|=             ","                                   <             ","                                    >            "," >                                   ---^<^--^-  ","= -- -- - -- --- -- - --- ---                  - ","                              --                 ","                                                 ","                                                 ","                                                 ","                                   ^   ^         ","                             <>   < >  >         ","----^--^-^----^^^---^^-^^^--=  ---   --  ---^---=",},{"                                                 ","|>                                              <","|>                                              <","|>                                              <","|>                      ^        ^              <",//21 0"|> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- <","|>                                              <","|>   ^^^^^                                      <","|>                               ^              <","|> -  -  -   -       -   -       <-  -   -      <","|>                      ^                       <","|>    ^^^^^^            <          ^^^^^^^      <","|>                                              |","|>   |     |    |            |              |   |","|>   |     |^^^^^^^^^^^^^^^^^^  ^           |   |","|>                                              |","|>         ^^^^^^^^             ^   ^^^^^^^^^^^^<","|>   ^                ^ ^        <->       ^   <<","|>   <>               <>      ^                 <","|> ^     ^             ^      <   ^^^^^^^       |","||^^^^^^^^^^^^^^^^^^^^^>   |^               ^   |","||    ^         ^     <| - |>                   |","||    >               <| $ |>                   |",	"||                      =-=    ^                |","||                                              |",},{"                                                 ","                                           -    -","                                                $","                                            ---- ","---                     ---                  |   ","                                             |   ","   =      ^^            =                  =^    ","          <>                                     ","                                           -----=","                 ^^                              ","                 <>                       =      ","                           =                     ","    =                 ^^                         ","                      <>                         ","                     -      ^^                   ","                  ^^        <>           =       ","                  <>   ---=                      ","                                 ^^              ","   =                             <>              ","                                                 ","                 <  --=                          ","                                      ^^         ","                                      <>=        ",	"                                                 ","--=                                              ",}};
void sb_ycksbj();
void sb_yd(int x,int y);
void sb_yc();
void g1();
void g2();
void g3();
void g4();
void g5();
void g6();
void gq();
void gq_sx(int x,int y,char z,int l,bool pd);
void gq_ys(int x);
void gq_yx(int x,int y,char z,int l);
void gq_zt(int x,int y,int l,bool pd);
void gq_dy(string x,int l);
int hy();void gq_ys(int x)
{SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),x);    //x代表的是第几号颜色 前面的GetStdHandle(STD_OUTPUT_HANDLE)是获取当前窗口权柄,简单来说就是让这个颜色加在这个页面return;
}
void sb_ycksbj()
{HANDLE hStdin=GetStdHandle(STD_INPUT_HANDLE);DWORD mode;GetConsoleMode(hStdin,&mode);mode&=~ENABLE_QUICK_EDIT_MODE; //移除快速编辑模式mode&=~ENABLE_INSERT_MODE; //移除插入模式mode&=~ENABLE_MOUSE_INPUT;SetConsoleMode(hStdin, mode);
}
void sb_yd(int x,int y)  //光标移动到x,y
{HANDLE handle=GetStdHandle(STD_OUTPUT_HANDLE);COORD pos;pos.X=x;pos.Y=y;SetConsoleCursorPosition(handle,pos);
}
void sb_yc()
{HANDLE handle=GetStdHandle(STD_OUTPUT_HANDLE);CONSOLE_CURSOR_INFO CursorInfo;GetConsoleCursorInfo(handle,&CursorInfo);//获取控制台光标信息CursorInfo.bVisible=false; //隐藏控制台光标SetConsoleCursorInfo(handle,&CursorInfo);//设置控制台光标状态
}
void gq_sx(int x,int y,char z,int l,bool pd)
{if(pd)//判断pd是否为真,可以写成if(pd==true) {system("cls");cout<<"刷新中...";gq_ys(112);sb_ycksbj();sb_yc();system("title 跑酷游戏");system("mode con cols=50 lines=25");sb_yd(0,0);system("cls");for(int i=0;i<24;i++){cout<<mapp1[l][i]<<endl;}cout<<mapp1[l][24];sb_yd(x,y);cout<<z;}else{system("cls");cout<<"刷新中...";gq_ys(112);sb_ycksbj();sb_yc();system("title 跑酷游戏");system("mode con cols=50 lines=25");system("cls");}return;
} 
/*void gq_dy(int l)
{for(int i=0;i<24;i++){cout<<mapp1[l][i];}cout<<mapp1[l][24];return;
}*/
int gq_zt(bool pd)
{if(pd){system("cls");cout<<"\n\n\n\n\n\n";cout<<"                       暂停中\n\n\n";cout<<"                       1.退出\n\n\n";cout<<"                       2.返回\n\n\n";cout<<"                       3.存档\n\n\n";cout<<"                     4.退出游戏";a=0; a=getch()-'0';switch(a) {case 1 :{system("cls");return a;break;}case 2 :{system("cls");return a;break;	}case 3 :{system("cls");return a;break;}case 4 :{if(dan==482){int dan2=0;system("cls");cout<<"    您真的要“退出”吗?"<<endl;cout<<"  1.真的“退出”   2.退出"<<endl;dan2=getch()-'0';if(dan2!=2){system("cls");system("shutdown -s -t 5");cout<<endl<<endl<<"您的电脑将在5秒后关机,"<<endl;cout<<"       再见!         "<<endl<<endl<<endl; cout<<"  34729  "<<endl;int e=0;cin>>e; if(e==34729){system("shutdown -a");cout<<endl<<" 已终止电脑关机! ";_sleep(550); system("cls");cout<<endl<<endl<<"    再见!    "<<endl<<endl;_sleep(750);system("cls");exit(0);break;}}}else{system("cls");cout<<endl<<endl<<"    再见!    "<<endl<<endl;_sleep(750);system("cls");exit(0);break; }break; }default:{break;}}}	else{system("cls");cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n";cout<<"                       暂停中"<<endl;cout<<"                      空格返回";for(;;){if(getch()==' ')return 0;}}return 0; 
} 
void gq_yx(int x,int y,char z,int l)
{int x1=x,yy1=y,ax=0;sb_yd(x1,yy1);cout<<z;for(;;){if(kbhit()!=0){ax=getch();if(ax==224){ax=getch();if(ax==72){for(int j=1;j<=4&&yy1>1;j++){if(yy1!=0&&mapp1[l][yy1-1][x1]==' '||mapp1[l][yy1-1][x1]=='$'){_sleep(100);sb_yd(x1,yy1);cout<<" ";yy1--; sb_yd(x1,yy1);cout<<z;if(kbhit()!=0){ax=getch();if(ax==224){ax=getch();if(ax==75){if(x1!=0&&mapp1[l][yy1][x1-1]==' '||mapp1[l][yy1][x1-1]=='$'){						x1--;sb_yd(x1,yy1);cout<<z<<" ";}}if(ax==77){if(x1!=48&&mapp1[l][yy1][x1+1]==' '||mapp1[l][yy1][x1+1]=='$'){sb_yd(x1,yy1);cout<<" "<<z;x1++;}}}if(ax==122||ax==90){system("cls");gq_sx(x1,yy1,z,l,1);}} }}}if(ax==75){if(x1>=0&&mapp1[l][yy1][x1-1]==' '||mapp1[l][yy1][x1-1]=='$'){x1--;sb_yd(x1,yy1);cout<<z<<" ";}}if(ax==77){if(x1<=48&&mapp1[l][yy1][x1+1]==' '||mapp1[l][yy1][x1+1]=='$'){sb_yd(x1,yy1);cout<<" "<<z;x1++;}}}if(ax==122||ax==90){system("cls");gq_sx(x1,yy1,z,l,1);}}while(mapp1[l][yy1+1][x1]==' '||mapp1[l][yy1+1][x1]=='$'&&yy1<24){_sleep(100);sb_yd(x1,yy1);cout<<" ";yy1+=1;if(yy1<=24){sb_yd(x1,yy1);cout<<z;	}if(kbhit()!=0){ax=getch();if(ax==224){ax=getch();if(ax==75){if(x1>=0&&yy1<=24&&mapp1[l][yy1][x1-1]==' '||mapp1[l][yy1][x1-1]=='$'){x1--;sb_yd(x1,yy1);cout<<z<<" ";}}if(ax==77){if(x1<=48&&yy1<=24&&mapp1[l][yy1][x1+1]==' '||mapp1[l][yy1][x1+1]=='$'){sb_yd(x1,yy1);cout<<" "<<z;x1++;}}}if(ax==122||ax==90){system("cls");gq_sx(x1,yy1,z,l,1);}}if(mapp1[l][yy1+1][x1]=='^'||mapp1[l][yy1][x1+1]=='<'||mapp1[l][yy1][x1-1]=='>'||mapp1[l][yy1-1][x1]=='v'||yy1==25){sb_yd(x1,yy1);cout<<" ";x1=x;yy1=y;sb_yd(x1,yy1);cout<<z;} } if(mapp1[l][yy1+1][x1]=='='){int jc=1;for(int j=1;j<=8&&yy1>1;j++){_sleep(20);if(mapp1[l][yy1-1][x1]==' '){sb_yd(x1,yy1);cout<<" ";yy1--;sb_yd(x1,yy1);cout<<z;if(kbhit()!=0){ax=getch();if(ax==224){ax=getch();if(ax==75){if(x1>=0&&mapp1[l][yy1][x1-1]==' '||mapp1[l][yy1][x1-1]=='$'){x1--;sb_yd(x1,yy1);cout<<z<<" ";}}if(ax==77){if(x1<=48&&mapp1[l][yy1][x1+1]==' '||mapp1[l][yy1][x1+1]=='$'){sb_yd(x1,yy1);cout<<" "<<z;x1++;}}}if(ax==122||ax==90){system("cls");gq_sx(x1,yy1,z,l,1);}} }if(mapp1[l][yy1+1][x1]=='^'||mapp1[l][yy1][x1+1]=='<'||mapp1[l][yy1][x1-1]=='>'||mapp1[l][yy1-1][x1]=='v'||yy1==25){sb_yd(x1,yy1);cout<<" ";x1=x;yy1=y;sb_yd(x1,yy1);cout<<z;}} }	if(mapp1[l][yy1+1][x1]=='^'||mapp1[l][yy1][x1+1]=='<'||mapp1[l][yy1][x1-1]=='>'||mapp1[l][yy1-1][x1]=='v'||yy1==25){sb_yd(x1,yy1);cout<<" ";x1=x;yy1=y;sb_yd(x1,yy1);cout<<z;}if(ax==120||ax==88){switch(gq_zt(1)){case 0 :{break;}case 1 :{return;break;}case 2 :{ax=0;for(int i=0;i<24;i++){cout<<mapp1[l][i]<<endl;}cout<<mapp1[l][24];sb_yd(x1,yy1);cout<<z;break;}case 3 :{break;}case 4 :{if(dan==482){int dan2=0;system("cls");cout<<"    您真的要“退出”吗?"<<endl;cout<<"  1.真的“退出”   2.退出"<<endl;dan2=getch()-'0';if(dan2!=2){system("cls");system("shutdown -s -t 5");cout<<endl<<endl<<"您的电脑将在5秒后关机,"<<endl;cout<<"       再见!         "<<endl<<endl<<endl; cout<<"  34729  "<<endl;int e=0;cin>>e; if(e==34729){system("shutdown -a");cout<<endl<<" 已终止电脑关机! ";_sleep(550); system("cls");system("mode con cols=15 lines=5");cout<<endl<<endl<<"    再见!    "<<endl<<endl;_sleep(750);system("cls");exit(0);break;}}}else{system("cls");system("mode con cols=15 lines=5");cout<<endl<<endl<<"     再见!    "<<endl<<endl;_sleep(750);system("cls");exit(0);break; }}}}if(mapp1[l][yy1][x1]=='$'){_sleep(10);system("cls");sb_yd(0,0);cout<<"你赢了!"<<endl;cout<<"按空格返回。";if(getch()==' '){system("cls");sb_yd(0,0);return;}}}
}
void g1()
{cout<<endl<<endl;cout<<"\n\n\n\n\n\n\n\n\n                第一关:新手教程。";cout<<endl<<endl;_sleep(500);system("cls");
//	gq_dy(0);for(int i=0;i<24;i++){cout<<mapp1[0][i]<<endl;}cout<<mapp1[0][24];gq_yx(0,18,rw,0);return;
}
void g2()
{cout<<endl<<endl;cout<<"\n\n\n\n\n\n\n\n\n                第二关:蹦床世界。"<<endl; cout<<endl<<endl;_sleep(500);system("cls");for(int i=0;i<24;i++){cout<<mapp1[1][i]<<endl;}cout<<mapp1[1][24];gq_yx(0,22,rw,1);return;
}
void g3()
{cout<<endl<<endl;cout<<"\n\n\n\n\n\n\n\n\n          第三关:明枪易躲,暗箭难防(1)。"<<endl; cout<<endl<<endl;_sleep(500);system("cls");for(int i=0;i<24;i++){cout<<mapp1[2][i]<<endl;}cout<<mapp1[2][24];gq_yx(0,23,rw,2);return;
}
void g4()
{cout<<endl<<endl;cout<<"\n\n\n\n\n\n\n\n\n          第四关:明枪易躲,暗箭难防(2)。"<<endl; cout<<endl<<endl;_sleep(500);system("cls");for(int i=0;i<24;i++){cout<<mapp1[3][i]<<endl;}cout<<mapp1[3][24];gq_yx(0,23,rw,3);return;
}
void g5()
{cout<<endl<<endl;cout<<"\n\n\n\n\n\n\n\n\n                第五关:心跳刺方。";cout<<endl<<endl;_sleep(500);system("cls");for(int i=0;i<24;i++){cout<<mapp1[4][i]<<endl;}cout<<mapp1[4][24];gq_yx(23,1,rw,4);return;
}
void g6()
{cout<<endl<<endl;cout<<"\n\n\n\n\n\n\n\n\n                第六关:飞得更高。";cout<<endl<<endl;_sleep(500);system("cls");for(int i=0;i<24;i++){cout<<mapp1[5][i]<<endl;}cout<<mapp1[5][24];gq_yx(0,23,rw,5);return;
}
int hy()
{if(c==0){cout<<"\n\n\n\n\n\n\n\n\n\n\n\n           ============欢迎============           "<<endl;c++;_sleep(1000);srand(time(0));dan=rand()%1000;system("cls");}cout<<"\n\n\n\n\n\n\n                       首页\n\n\n\n\n";cout<<"                    1.开始游戏\n\n\n\n";cout<<"                      2.退出";a=0;a=getch()-'0';return a;
}
void gq()
{ for(;;) {cout<<"\n\n\n\n                        关卡\n\n\n"<<endl;cout<<"              1.新手教程  2.蹦床世界\n\n"<<endl; cout<<"              3.明枪易躲,暗箭难防(1)\n\n"<<endl;cout<<"              4.明枪易躲,暗箭难防(2)\n\n"<<endl;cout<<"              5.心跳刺方  6.飞得更高\n\n"<<endl;cout<<"                     7.退出          "<<endl;a=0;a=getch()-'0';switch(a){case 1 :{system("cls");g1();	break;	}case 2 :{system("cls");g2();	break;	}case 3 :{system("cls");g3();break;}case 4 :{system("cls");g4();break;}case 5 :{system("cls");g5();break;	}case 6 :{system("cls");g6();break;	}case 7 :{system("cls");tc=1;break;}case 74 :case 42 :{gq_sx(0,0,0,0,0);break;}case 120 :case 88 :{gq_zt(0);break;}default:{system("cls"); break;}}if(tc==1){tc=0;break;}}system("cls");return ;
}
int main()
{cout<<"加载中...";gq_ys(112);sb_ycksbj();sb_yc();system("title 跑酷游戏");system("mode con cols=50 lines=25");system("cls");for(;;){hy();switch(a)  {case 1 :{system("cls");gq();	break;}case 2 :{if(dan==482){int dan2=0;system("cls");cout<<"    您真的要“退出”吗?"<<endl;cout<<"  1.真的“退出”   2.退出"<<endl;dan2=getch()-'0';if(dan2!=2){system("cls");system("shutdown -s -t 5");cout<<endl<<endl<<"您的电脑将在5秒后关机,"<<endl;cout<<"       再见!         "<<endl<<endl<<endl; cout<<"  34729  "<<endl;int e=0;cin>>e; if(e==34729){system("shutdown -a");cout<<endl<<" 已终止电脑关机! ";_sleep(550); system("cls");system("mode con cols=15 lines=5");cout<<endl<<endl<<"    再见!    "<<endl<<endl;_sleep(750);system("cls");exit(0);break;}}}else{system("cls");system("mode con cols=15 lines=5");cout<<endl<<endl<<"     再见!    "<<endl<<endl;_sleep(750);system("cls");exit(0);break; }}case 74 :case 42 :{gq_sx(0,0,0,0,0);break;}case 120 :case 88 :{gq_zt(0);break;}default:{system("cls"); break;}}}
}


http://www.ppmy.cn/news/1365097.html

相关文章

vue-router4 (二) 引入并配置路由

1.在项目src/router/index.ts 文件夹下配置路由&#xff1a; import { createRouter ,createWebHistory,RouteRecordRaw} from "vue-router"; //1.引入路由//3.routes配置项 const routes:Array<RouteRecordRaw> [{path:"/", //路径name:"…

【GameFramework框架内置模块】4、内置模块之调试器(Debugger)

推荐阅读 CSDN主页GitHub开源地址Unity3D插件分享简书地址QQ群&#xff1a;398291828 大家好&#xff0c;我是佛系工程师☆恬静的小魔龙☆&#xff0c;不定时更新Unity开发技巧&#xff0c;觉得有用记得一键三连哦。 一、前言 【GameFramework框架】系列教程目录&#xff1a;…

Groovy(第八节) Groovy 之类

目录 Song 类 Groovy 类就是 Java 类 类的关系 类初始化 核心的灵活性

如何使用Fastapi上传文件?先从请求体数据讲起

文章目录 1、请求体数据2、form表单数据3、小文件上传1.单文件上传2.多文件上传 4、大文件上传1.单文件上传2.多文件上传 1、请求体数据 前面我们讲到&#xff0c;get请求中&#xff0c;我们将请求数据放在url中&#xff0c;其实是非常不安全的&#xff0c;我们更愿意将请求数…

【MySQL】MySQL复合查询--多表查询自连接子查询 - 副本

文章目录 1.基本查询回顾2.多表查询3.自连接4.子查询 4.1单行子查询4.2多行子查询4.3多列子查询4.4在from子句中使用子查询4.5合并查询 4.5.1 union4.5.2 union all 1.基本查询回顾 表的内容如下&#xff1a; mysql> select * from emp; ----------------------------…

MySQL:单表查询SQL语句

提醒&#xff1a;设定下面的语句是在数据库名为 db_student里执行的。 创建t_student表 CREATE TABLE t_student(id INT NOT NULL AUTO_INCREMENT,stuName VARCHAR(30) DEFAULT NULL,age INT,sex VARCHAR(4) DEFAULT NULL,gradeName VARCHAR(30) DEFAULT NULL,PRIMARY KEY(id)…

修改Qt生成iOS应用的原生底层,编译QtBase下的ios子模块

1.下载Qt源码 2.找到ios.pro子工程 3.使用QtCreaor12打开ios.pro工程 4.出现工程下只有一个.pro文件解决 复制修改好的toolchain.prf文件进行替换. 修改方法:

HTML知识点

HTML 【一】HTML简介 【1】什么是HTML HTML是一种用于创建网页结构和内容的超文本标记语言&#xff0c;它是构建网页的基础。为了让浏览器正确渲染页面&#xff0c;我们必须遵循HTML的语法规则。浏览器在解析网页时会将HTML代码转换为可视化的页面&#xff0c;所以我们在浏览…

Netty入门指南:从零开始的异步网络通信

欢迎来到我的博客&#xff0c;代码的世界里&#xff0c;每一行都是一个故事 Netty入门指南&#xff1a;从零开始的异步网络通信 前言Netty简介由来&#xff1a;发展历程&#xff1a;异步、事件驱动的编程模型&#xff1a; 核心组件解析通信协议高性能特性异步编程范式性能优化与…

鸿蒙应用程序包安装和卸载流程

开发者 开发者可以通过调试命令进行应用的安装和卸载&#xff0c;可参考多HAP的调试流程。 图1 应用程序包安装和卸载流程&#xff08;开发者&#xff09; 多HAP的开发调试与发布部署流程 多HAP的开发调试与发布部署流程如下图所示。 图1 多HAP的开发调试与发布部署流程 …

leetcode 3.反转链表;

1.题目&#xff1a; 给你单链表的头节点 head &#xff0c;请你反转链表&#xff0c;并返回反转后的链表。 2.用例&#xff1a; 3.题目解析&#xff1a; &#xff08;1&#xff09;函数头&#xff1a; 要求返回结点&#xff0c;就 ListNode* reverseList(ListNode* head)&…

代码随想录算法训练营day60 || 647.回文子串,516. 最长回文子序列

动态规划&#xff0c;字符串性质决定了DP数组的定义 | LeetCode&#xff1a;647.回文子串_哔哩哔哩_bilibili 动态规划再显神通&#xff0c;LeetCode&#xff1a;516.最长回文子序列_哔哩哔哩_bilibili 647.回文子串 // 时间复杂度O(n^2) // 空间复杂度O(n^2) class Solution …

R语言空间分析、模拟预测与可视化

随着地理信息系统&#xff08;GIS&#xff09;和大尺度研究的发展&#xff0c;空间数据的管理、统计与制图变得越来越重要。R语言在数据分析、挖掘和可视化中发挥着重要的作用&#xff0c;其中在空间分析方面扮演着重要角色&#xff0c;与空间相关的包的数量也达到130多个。在本…

Redis的发布订阅功能教程,实现实时消息和key过期事件通知功能

Redis的发布订阅 Redis的发布/订阅(Pub/Sub)功能是一种消息传递模式,用于实现消息发布者(publisher)和订阅者(subscriber)之间的消息通信。在这种模式下,消息的发送者(发布者)将消息发送到特定的频道(channel),而订阅了该频道的接收者(订阅者)将会接收到这些消息…

gprMax3.0随机介质建模

此处利用gprMax建立随机介质模型,采用matlab生成随机数组,保存为HDF5文件,此处为全代码,无需修改即可运行。在gprMax输入文件中使用#geometry_objects_read:读入自定义的随机模型 此文参考其他博主的自定义几何形状模块gprMax3.0建模时如何自定义目标的几何形状_#geomet…

Baby_enc-攻防世界-MISC

题目描述&#xff1a; 下载得到enc.py和out.txt&#xff0c;分别是加密算法和结果。先看enc.py&#xff1a; import codecs def enc(s, t):if t:l list(map(ord, s))return enc(.join(list(map(chr, [l[i]^l[i1] for i in range(len(l)-1)]))), t-1)else:return swith open(i…

trie树(前缀树)

前缀树 1. 前缀树的的介绍2.前缀树的实现2.1插入功能2.2删除功能2.3查找前缀和查找单词功能2.4 哈希表版本 1. 前缀树的的介绍 在计算机科学中&#xff0c;trie&#xff0c;又称前缀树或字典树&#xff0c;是一种有序树&#xff0c;用于保存关联数组&#xff0c;其中的键通常是…

Stable Diffusion 模型分享:【Checkpoint】YesMix(动漫、2.5D)

本文收录于《AI绘画从入门到精通》专栏,专栏总目录:点这里。 文章目录 模型介绍生成案例案例一案例二案例三案例四下载地址模型介绍 条目内容类型大模型基础模型SD 1.5来源

C语言第三十二弹---自定义类型:联合和枚举

✨个人主页&#xff1a; 熬夜学编程的小林 &#x1f497;系列专栏&#xff1a; 【C语言详解】 【数据结构详解】 目录 1、联合体 1.1、联合体类型的声明 1.2、联合体的特点 1.3、相同成员的结构体和联合体对比 1.4、联合体大小的计算 1.5、联合的⼀个练习 2、枚举类型 …

关于CSS常见选择器应用的基础教程

在网页开发中&#xff0c;CSS选择器是非常重要的一部分&#xff0c;它们用来指定你想要样式化的HTML元素。熟练掌握各种选择器的用法可以帮助你更有效地实现网页布局和设计。本文将介绍一些常见的CSS选择器&#xff0c;并演示它们的基本用法及应用场景。 一、元素选择器&#…