呵呵!!!
#include#include #include #include #include #include #define N 20using namespace std;void mianPage(); //主界面void end(); // 退出界面void gotxy(int x,int y); //位置函数;void color(int a); //颜色函数void play();//主要操作过程void init();class snake{};void LoadData();void saveData();int Score;//存储分数void gotxy(int x,int y){ COORD pos; pos.X=x; pos.Y=y; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),pos);}void color(int a){ SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),a);}void mainPage(){ system("cls"); char c; cout< < 0;i--)//蛇移动的关键步骤 { snake[i][0]=snake[i-1][0]; snake[i][1]=snake[i-1][1]; gotxy(snake[i][0],snake[i][1]); color(14); cout<<"*"<