#include<iostream>
#include<conio.h>
#include<windows.h>
#define LENGTH 25
#define WIDTH 22
using namespace std;
int map[LENGTH][WIDTH];
int mat[LENGTH][WIDTH];
void gotoxy(int x,int y) { /*位置函数*/
COORD pos;
pos.X = 2 * x;
pos.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),pos);
}
void draw() {
system("color 2");
int i;
for(i=0; i<LENGTH; ++i) {
gotoxy(i,0);
cout<<"■";
gotoxy(i,WIDTH);
cout<<"■";
}
for(i=1; i<WIDTH; ++i) {
gotoxy(0,i);
cout<<"■";
gotoxy(LENGTH-1,i);
cout<<"■";
}
gotoxy(10,8);
cout<<"推箱子";
gotoxy(9,10);
cout<<"请选择关卡";
gotoxy(9,12);
cout<<"一共有8关";
gotoxy(8,14);
cout<<"请输入数字1到8";
gotoxy(LENGTH+3,3);
cout<<"游戏操作a,w,s,d";
gotoxy(LENGTH+3,5);
cout<<"规则:箱子送到指定地点" ;
gotoxy(LENGTH+3,7);
cout<<"请使用英文输入法";
gotoxy(LENGTH+3,9);
cout<<"y为重新开始本关";
gotoxy(11,16);
}
void qingchu() { //清除函数
int i,j;
for(i=0; i!=LENGTH; ++i)
for(j=0; j!=WIDTH+1; ++j) {
gotoxy(i,j);