⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 oai.h

📁 java game uploading now
💻 H
字号:
// OAI.h: interface for the COAI class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_OAI_H__0E1DDBE1_6BA6_11D7_B83E_973C85857441__INCLUDED_)
#define AFX_OAI_H__0E1DDBE1_6BA6_11D7_B83E_973C85857441__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

typedef struct tagPOSITION {
   int x;
   int y;
}pos;

typedef struct struct_move_struct{
	int no_legal_moves;	//no of legal moves
	pos disk_turned[40][21];	//40 max possible moves, 1 move postion + 19 max disk turned + 1 spare
}move_st;

class COAI  
{
public:
	int pmobility(int who);
	void disks_count(int &bcount, int &wcount);
	void play_move(int who, int x, int y);
	BOOL anyvalidmove(int who);
	void new_board();
	int disks_count();
	int search(int alpha, int beta, int search_depth);
	int search2(int alpha, int beta, int search_depth);
	BOOL move(int who, int &score, int &x, int &y, int &time, int &nodes);
	bool is_legal(int who, int x, int y);
	BOOL is_legal2(int who, int x, int y, BOOL &pmob);
	int stat_eval();
	int disk_difference(int to_play);
	int corner(int who);
	int mobility(int who);
	void mobility(int who, int &mob, int &pmob);
	void play_move(move_st *move_struct, int movenum);
	void undo_move(move_st *move_struct, int movenum);
	void order_moves(move_st *move_struct, int *move_order);
	int set_up_legal_moves(move_st *move_struct, int who);

	int searchmethod;	//0=negamax, 1=negascout
	BOOL move_order_search;
	BOOL ordermove;
	int board[8][8];
	int to_play;	//the player who has the turn
	int depth, eg_empty;
	long int e_count;	//no of leaves examined
	int total_disks;
	int eval_table[40];
	
	COAI();
	virtual ~COAI();

private:
	int falling();
	int raising();
	int upndown();
};

#endif // !defined(AFX_OAI_H__0E1DDBE1_6BA6_11D7_B83E_973C85857441__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -