資源簡介
六子棋,是由臺灣交通大學吳毅成教授所發明的一種游戲,由五子棋改良而來,相比較而言,它具有規則簡單、變化復雜、游戲公平三個很好的特性。在六子棋里,除了持黑的第一手下一子外,黑白雙方輪流各下兩子,最后連成六子者勝。
代碼片段和文件信息
#include?
#include?
#include?
//#include?
#include?
#include?
#include?
#include?
#include?
#include?
using?namespace?std;
enum?paint_char{black=1white=2empty=-1nempty=-2side=3sum=3};
enum?vertion{playercomputer};
const?int?chessbored_size=21;//棋盤尺寸?
int?chessbored[chessbored_size][chessbored_size];//棋盤?
int?cursor_xcursor_y;//光標坐標?
int?player_color=black;//玩家棋子顏色
int?computer_color=white;?//電腦棋子顏色?
const?int?max2=2147483647fen_max=99999999;
const?int?min2=-2147483647fen_min=-99999999;
int?wide=4depth=6;//搜索的深度和廣度?
int?regret_array[180][chessbored_size][chessbored_size]regret_num;//悔棋記錄數組
struct?node
{
int?ij;
int?value;
int?c[2][4];//各方向形成的連接的子數?
friend?bool?operator?(node?anod
- 上一篇:簡單的VC++代理服務器源程序
- 下一篇:實現詞法分析器
評論
共有 條評論