#include "../Engine/BrickEngine.h"
void Run();
int row = 31, col = 51;
int px = 1, py = 1;
int block[29][49]; // 0代表空, 1代表墙
Vector2 dir[4] = {
{-1, 0}, {0, -1}, {1, 0}, {0, 1}}; // 0左, 1上, 2右, 3下
void Initialize()
{
// 随机种子
srand((int)time(0));
// 设置边框
FillRec(0, 0, col, 1, "■");
FillRec(0, 1, 1, row - 2, "■");
FillRec(col - 1, 1, 1, row - 2, "■");
FillRec(0, row - 1, col, 1, "■");
}
bool CheckBlockType(int x, int y, int type, bool judgeSame = true)
{
bool ans = 0 < x && x < col - 1 && 0 < y && y < row - 1;
bool isSame = block[y - 1][x - 1] == type;
ans = ans && (judgeSame ? isSame : !isSame);
return ans;
}
void Dfs(int px, int py)
{
int d = (rand() & 3);
for (int i = 4; i--;)
{
int j = (d + i & 3)
12-20