张凌枫<2016.12.6>【连续第19天总结】
A.今日任务
1.封装下篇章节总结
2.迷宫函数
B.具体任务
1.把常指针和常引用练习一遍
2.开始写迷宫函数
3.DOS界面的迷宫真是太。。。。。。。丑了
4.我觉得我还要多学习一下,想慢慢学之后的继承篇,多复习之前的东西(前面那些不怎么用的知识点都开始忘了)
5.想方设法美化迷宫至少让他好看一点
6.分号啊!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
附代码:
#include <iostream>
#include <string>
#include <Windows.h>
#include <conio.h>
using namespace std;
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
class Map
{
public:
void printMap();
private:
int map[9][9] =//迷宫数组
{
{ 1,1,1,1,1,1,1,0,1 },
{ 1,1,1,1,1,0,0,0,1 },
{ 1,1,1,1,1,0,1,1,1 },
{ 1,1,1,1,1,0,1,1,1 },
{ 1,1,1,1,1,0,1,1,1 },
{ 1,1,1,1,1,0,1,1,1 },
{ 1,1,1,1,1,0,1,1,1 },
{ 1,0,0,0,0,0,1,1,1 },
{ 1,0,1,1,1,1,1,1,1 }
};
};
void Map::printMap()//打印迷宫函数
{
for (int i = 0;i <= 8;i++)
{
for (int j = 0;j <= 8;j++)
{
if (map[i][j] == 1)
{
cout << '*';
}
else
{
cout << ' ';
}
}
cout << endl;
}
}
int main()
{
Map *p = new Map();
p->printMap();
cout << endl << endl << endl << "大爷你的迷宫终于他喵的打出来啦!!!!!" << endl;
SetConsoleCursorPosition(handle, { 1,8 });
cout << "T" << endl;
delete p;
p = NULL;
_getch();
return 0;
}
明日任务
迷宫函数(把小人放进去)
复习复习