c15_4f.h
来自「C++Builder编程实例详解,用具体的例子阐明C++的一些基本操作,所有程序」· C头文件 代码 · 共 82 行
H
82 行
//---------------------------------------------------------------------------
#ifndef C15_4fH
#define C15_4fH
//---------------------------------------------------------------------------
#include <vcl\Classes.hpp>
#include <vcl\Controls.hpp>
#include <vcl\StdCtrls.hpp>
#include <vcl\Forms.hpp>
#include <vcl\Menus.hpp>
#include <vcl\ComCtrls.hpp>
#include <vcl\ExtCtrls.hpp>
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// 自定义
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define RedPlayer 1
#define BluePlayer 2
#define OtherPlayer -1
#define NoPlayer 0
typedef struct{
long x1;
long y1;
long x2;
long y2;
long x3;
long y3;
long x4;
long y4;
}MyRect;
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TMainMenu *MainMenu1;
TMenuItem *Game;
TMenuItem *NewGame;
TMenuItem *N3;
TMenuItem *Exit;
TStatusBar *StatusBar1;
TPaintBox *PaintBox1;
TTimer *Timer1;
void __fastcall NewGameClick(TObject *Sender);
void __fastcall PaintBox1Paint(TObject *Sender);
void __fastcall FormResize(TObject *Sender);
void __fastcall PaintBox1MouseUp(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y);
void __fastcall FormCreate(TObject *Sender);
void __fastcall Timer1Timer(TObject *Sender);
void __fastcall ExitClick(TObject *Sender);
private: // User declarations
public: // User declarations
void NewGameDraw();
void GameDraw();
void DrawRed(int, int, int);
void DrawBlue(int, int, int);
bool NoWon();
bool IsWon(int);
bool WonAt(int, int, int, int);
void BlueMove(); // 计算机走棋函数,计算最优位置。
bool IsBlue(int, int, int);
bool IsRed(int, int, int);
bool IsNot(int, int, int);
bool IsInBorder(int &, int &, int &);
void PaintDraw();
int OneStepX;
int OneStepY;
short Block[5][5][5];
MyRect Border[3][3][3];
bool Gaming;
bool Drawable;
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?