📄 state.h
字号:
#pragma once
struct Position
{
int row;
int col;
};
const Position offset[4] =
{
{0, 1}, // right
{1, 0}, // down
{0, -1}, // left
{-1, 0}, // up
};
class CState
{
friend class CEightNumView;
friend class CStateList;
friend int Distance(CState* a, CState* b);
public:
CState(void);
CState(const CState& state);
~CState(void);
bool IsEvenState();
void Free();
void GetPos(int d, int& r, int& c);
bool NewChild(int dir, CState* destState, CState*& c);
void RemoveChild(CState* c); // but don't delete the space!
void UpdateChildren(int var);
private:
int num[3][3];
int childNum;
CState* child[4];
CState* parent;
int g, h;
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -