?? ninebox.cpp
字號:
// NineBox.cpp: implementation of the NineBox class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Eight.h"
#include "NineBox.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
NineBox::NineBox()
{
ResetValue();
}
NineBox::~NineBox()
{
}
void NineBox::MoveUp()
{
int x,y;
this->GetXYByValue(0,x,y);
if (x>0)
{
this->swap(x,y,x-1,y);move_type=1;
}
}
void NineBox::MoveDown()
{
int x,y;
this->GetXYByValue(0,x,y);
if (x<2)
{
this->swap(x,y,x+1,y);move_type=2;
}
}
void NineBox::MoveLeft()
{
int x,y;
this->GetXYByValue(0,x,y);
if (y>0)
{
this->swap(x,y,x,y-1);move_type=3;
}
}
void NineBox::MoveRight()
{
int x,y;
this->GetXYByValue(0,x,y);
if (y<2)
{
this->swap(x,y,x,y+1);move_type=4;
}
this->GetXYByValue(0,x,y);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -