#include
#include
#include
#include
#include
#include
using namespace std;
#define UP 72;
#define DOWN 80;
#define LEFT 75;
#define RIGHT 77;
struct xyVal
{
int x;
int y;
};
queue Que;
int main() {
int level = 1;
clock_t levelTime = 10 * 1000;
//新建并初始化工作空间
char playSpace[22][22];
for (int i = 1; i < 21; i++)
for (int j = 1; j < 21; j++)
playSpace[i][j] = 0;
for (int i = 0; i < 22; i++)
{
playSpace[0][i] = ‘@‘;
playSpace[21][i] = ‘@‘;
}
for (int i = 1; i < 21; i++)
{
playSpace[i][0] = ‘@‘;
playSpace[i][21] = ‘@‘;
}
//核心
//生成头部*和一个果实$
int xVal yVal xFood yFood;
srand(time(0));
xVal = rand() % 14 + 3;
yVal = rand() % 14 + 3;
playSpace[xVal][yVal] = ‘*
评论
共有 条评论