课程名称:趣味c++进阶
章节名称:第七章结束语
讲师姓名:Redknot
内容概述:
#include"CheckerBoard.h"
#include<stdlib.h>
#include<stdio.h>
CheckerBoard::CheckerBoard(int w,int h)
{
width=w;
height=h;
table=(Chessman*)malloc(width*height*sizeof*sizeof*sizeof(Chessman));)
for (int i=0;i<width*height;i++)
table[i].type=ChessmanType::
}
CheckerBoard::~CheckerBoard()
{
if(table!=nullptr)
free(table);
table=nullptr;
}
int CheckBoard::Get(int%,int y)
{
int index=y*width+x;
return table[intdex];
}
class CheckBoard
{'public:
CheckerBoard(int x,int y);
~CheckBoard();
Chessman Get(int x,int y);
int Print();
int width=0;
int height=0;
Chessman*table=nullptr;
};
学习心得:五子棋
学习截图: