更新了开始动画,修复了一些BUG。
下面是代码:
#include<bits/stdc++.h>//dev专属 VC不用
#include <windows.h>
#include <iostream>
#include <stdio.h>
#include <Windows.h>
#include <conio.h>
#include <string.h>
#include <ctime>
#include <stdlib.h>
#include <vector>
#include <unistd.h>
#include <tchar.h>
#include <fstream>
#include <sys/time.h>
#include<iostream>
#include<bits/stdc++.h>
#include<iomanip>
#include<string>
#include<cstdlib>
#include<ctime>
#include<windows.h>
#include<conio.h>
#include<fstream>
#include <mmsystem.h>
#define qdo 262
#define qre 294
#define qmi 330 //q前缀为低音,1后缀为高音,s前缀为半音阶
#define qfa 349
#define qso 392
#define qla 440
#define qsi 494
#define do 523
#define re 578
#define mi 659
#define fa 698
#define so 784
#define la 880
#define si 988
#define do1 1046
#define re1 1175
#define mi1 1318
#define fa1 1480
#define so1 1568
#define la1 1760
#define si1 1976
#define sqdo 277
#define sqre 311
#define sqfa 370
#define sqso 415
#define sqla 466
#define sdo 554
#define sre 622
#define sfa 740
#define sso 831
#define sla 932
#define sdo1 1046
#define sre1 1245
#define sfa1 1480
#define sso1 1661
#define sla1 1865
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
using namespace std;
void cout_sleep(char n[]){for(int i=0;i<strlen(n);i++){cout<<n[i];if(n[i]!=' '){Sleep(100);}}
}
void gs(long long x, long long y, string str)
{for (long long i = 1; i <= x; i++)cout << "n";for (long long i = 1; i <= y; i++)cout << " ";cout << str;return;
}//结构体与类提前声明struct hl//行列{long long h, l;};//函数提前声明bool axj(long long key);hl sbwz(bool x, bool n);//鼠标位置void ydgb(long long h, long long l);//移动光标到指定位置void yanse(int n);//颜色//常量const long long ESC = 27,//电脑左上角的escEnter = 13,//回车Tab = 9,//esc下面一些的tabShang = 38,//、Xia = 40,// |方向键Zuo = 37,// |You = 39,// /Kong = ' ',//空格z_sb = VK_LBUTTON,//鼠标左键y_sb = VK_RBUTTON,//鼠标右键Shift = VK_SHIFT,//上档z_Shift = VK_LSHIFT,//左边的SHIFTy_Shift = VK_RSHIFT,//右边的shiftCtrl = VK_CONTROL,//控制z_Ctrl = VK_LCONTROL,//左边的Ctrly_Ctrl = VK_RCONTROL,//右边的CtrlAlt = VK_MENU,//windows右边的altz_Alt = VK_LMENU,//左……y_Alt = VK_RMENU,//右……(我不说也知道)A = 'A',//这些就是字母B = 'B',C = 'C',D = 'D',E = 'E',F = 'F',G = 'G',H = 'H',I = 'I',J = 'J', K = 'K',L = 'L',M = 'M',N = 'N',O = 'O',P = 'P',Q = 'Q',R = 'R',S = 'S',T = 'T',U = 'U',V = 'V',W = 'W',X = 'X',Y = 'Y',Z = 'Z';//结构体与类class anniu//这个是设置按钮的{private:short h_1, l_1, h_2, l_2, ys1, ys2;string nr;public:void csh(short hh_1, short ll_1, short hh_2, short ll_2, string _nr, short _yanse1, short _yanse2);bool gx_ax(bool f);};struct cdhs//存档结构体{void out(int n, string name);void out(long long n, string name);void out(bool n, string name);void out(char n, string name);void out(string n, string name);void in(int& n, string name);void in(long long& n, string name);void in(bool& n, string name);void in(char& n, string name);void in(string& n, string name);};//成员函数void anniu::csh(short hh_1 = 1, short ll_1 = 1, short hh_2 = 1, short ll_2 = 1, string _nr = " ", short _yanse1 = 240, short _yanse2 = 7){h_1 = hh_1;l_1 = ll_1;h_2 = hh_2;l_2 = ll_2;ys1 = _yanse1;ys2 = _yanse2;nr = _nr;return;}bool anniu::gx_ax(bool f = 1){short h = sbwz(1, 1).h, l = sbwz(1, 1).l, t = -1;if (h >= h_1 && h <= h_2 && l >= l_1 && l <= l_2){yanse(ys2);for (short i = h_1; i <= h_2; i++){ydgb(i, l_1);for (short j = l_1; j <= l_2; j++){t++;cout << nr[t];}}if ((axj(z_sb) && (f == 1)) || (axj(y_sb) && (f == 0))){return 1;}}else{yanse(ys1);for (short i = h_1; i <= h_2; i++){ydgb(i, l_1);for (short j = l_1; j <= l_2; j++){t++;cout << nr[t];}}return 0;}}void cdhs::out(int n, string name)//存档,以后更新时会用的,保存数值{ofstream cd(&name[0]);cd << n;cd.close();return;}void cdhs::out(long long n, string name){ofstream cd(&name[0]);cd << n;cd.close();return;}void cdhs::out(bool n, string name){ofstream cd(&name[0]);cd << n;cd.close();return;}void cdhs::out(char n, string name){ofstream cd(&name[0]);cd << n;cd.close();return;}void cdhs::out(string n, string name){ofstream cd(&name[0]);cd << n;cd.close();return;}void cdhs::in(int& n, string name){ifstream cd(&name[0]);cd >> n;cd.close();return;}void cdhs::in(long long& n, string name){ifstream cd(&name[0]);cd >> n;cd.close();return;}void cdhs::in(bool& n, string name){ifstream cd(&name[0]);cd >> n;cd.close();return;}void cdhs::in(char& n, string name){ifstream cd(&name[0]);cd >> n;cd.close();return;}void cdhs::in(string& n, string name){ifstream cd(&name[0]);cd >> n;cd.close();return;}//函数bool axj(long long key){return (GetKeyState(key) < 0);}void bout(string n, long long s = 50, bool f = 0, char key = 13)//输出{for (long long i = 0; i < n.size(); i++){if (f && GetKeyState(key) < 0){cout << n.substr(i, n.size());return;}cout << n[i];Sleep(s);}return;}void gckdx(short h, short l)//设置窗口大小{string n = "mode con cols=", t = "";while (l > 0){t = t + char(l % 10 + '0');l /= 10;}for (short i = t.size() - 1; i >= 0; i--){n = n + t[i];}n = n + " lines=", t = "";while (h > 0){t = t + char(h % 10 + '0');h /= 10;}for (short i = t.size() - 1; i >= 0; i--){n = n + t[i];}system(&n[0]);return;}void gckm(string n)//修改窗口名称{string t = "title ";t += n;system(&t[0]);return;}hl sbwz(bool x = 1, bool n = 1)//鼠标位置{HANDLE hOutput = GetStdHandle(STD_OUTPUT_HANDLE);HWND h = GetForegroundWindow();CONSOLE_FONT_INFO consoleCurrentFont;hl hl;POINT p;if (x){GetCursorPos(&p);ScreenToClient(h, &p);}else{GetCursorPos(&p);}if (n){GetCurrentConsoleFont(hOutput, FALSE, &consoleCurrentFont);p.x /= consoleCurrentFont.dwFontSize.X;p.y /= consoleCurrentFont.dwFontSize.Y;}hl.h = p.y + 1;hl.l = p.x + 1;return hl;}void yanse(int n)//颜色{SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), n);return;}void ycbj()//移除快速编辑模式{HANDLE hStdin = GetStdHandle(STD_INPUT_HANDLE);DWORD mode;GetConsoleMode(hStdin, &mode);mode &= ~ENABLE_QUICK_EDIT_MODE;SetConsoleMode(hStdin, mode);return;}void ycgb()//隐藏光标{CONSOLE_CURSOR_INFO cursor;cursor.bVisible = FALSE;cursor.dwSize = sizeof(cursor);HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);SetConsoleCursorInfo(handle, &cursor);return;}void ydgb(long long h, long long l)//移动光标{COORD pos = { l - 1,h - 1 };HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);SetConsoleCursorPosition(hOut, pos);return;}
string name;char dt[15][30],yutu,fx,sj=60,sl[15][30]; // 0 1 2 3int sdf1=8,sdf2=8,g=1,die,gw1=9,gw2=9,hp=10,gwhp=1;int pai = 400,ban = 200,ting = 128;int szt=0,gzt=0;int slsh=0;bool f=1;//合成int xz=5;bool tc=1;string q=" 空",w=" 空",e=" 空";//[][][]string a=" 空",s=" 空",d=" 空";//[][][]string z=" 空",x=" 空",c=" 空";//[][][]void gotoxy(int x=0,int y=0)
{COORD c;c.X=x;c.Y=y;SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),c);
}void _Clearscreen(int x,int y,int p){//清空坐标后p-1个字符(包括坐标上的字符)gotoxy(x-1,y);for(int i=1;i<=p;i++)cout<<' ';
}
void _Clearscreen(int p){//清空光标后p-1个字符(包括光标上的字符)printf("b");for(int i=1;i<=p;i++)cout<<' ';
}
void _Clearscreen(bool flag=1){//清空屏幕if(flag==1){//双缓冲HANDLE hStdOut; CONSOLE_SCREEN_BUFFER_INFO csbi; DWORD count; DWORD cellCount; COORD homeCoords = { 0, 0 };hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);if (hStdOut == INVALID_HANDLE_VALUE) return;if (!GetConsoleScreenBufferInfo(hStdOut, &csbi)) return;cellCount = csbi.dwSize.X *csbi.dwSize.Y;if (!FillConsoleOutputCharacter(hStdOut, (TCHAR) ' ', cellCount, homeCoords, &count )) return;if (!FillConsoleOutputAttribute(hStdOut, csbi.wAttributes, cellCount, homeCoords, &count )) return;SetConsoleCursorPosition(hStdOut, homeCoords);}else if(flag==0){//单缓冲HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);COORD coordScreen = {0, 0};SetConsoleCursorPosition( hConsole, coordScreen );}}void color(int a)
{SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),a);
/* 1 深蓝色2 深绿色3 深青色4 深红色5 深粉色i 黄色7 深白色8 灰色9 浅蓝色10 浅绿色11 浅青色12 浅红色13 浅粉色14 浅黄色15 浅白色背景1~15 黑色16~31 深蓝色32~47 深绿色48~63 深青色64~79 深红色'S'~95 深粉色96~111 深黄色112~127 深白色128~143 灰色144~159 浅蓝色160~1'A' 浅绿色176~191 浅青色192~207 浅红色208~223 浅粉色224~239 浅黄色240~255 浅白色
*/
}
void printf_red(const char *s)
{printf("