资源简介
如果你做机器博弈,这可以供你参考,不容易下的哦。希望对你有帮助。
代码片段和文件信息
#include
#include
#include
#include
#include “amazons.h“
#include “board.h“
#include “position.h“
#include “makros.h“
#include “callbacks.h“
/* local Prototypes */
static void fill_a_square(GnomeCanvasGroup *group
double x1 double y1 double x2 double y2 char *color);
static void get_square_color(int square char *color);
/* Globals */
int what_next; //
extern Board *board;
extern struct options options;
extern struct game_states states;
extern int ok;
extern time_t start;
Square legal_moves[100];
void init_game_board(GtkWidget *GamazonsMain)
{
int ij;
char color[256];
GtkWidget *w = lookup_widget(GamazonsMain BOARD_NAME);
board = (Board *) malloc(sizeof(Board));
board->canvas = GNOME_CANVAS(w);
/* set where can the canvas scroll (our usable area) */
gnome_canvas_set_scroll_region(board->canvas 0.0 0.0
BOARD_SIZE*CELL_SIZE + 2*BOARD_BORDER
BOARD_SIZE*CELL_SIZE + BOARD_BORDER);
/* set the size of the widget */
gtk_widget_set_usize(w
BOARD_SIZE*CELL_SIZE + 2*BOARD_BORDER
BOARD_SIZE*CELL_SIZE + BOARD_BORDER);
/* initialize pieces */
for (i=0; i {
for (j=0; j {
board->squares[i][j] = NOTHING;
}
}
gtk_signal_connect(GTK_object(board->canvas) “event“
GTK_SIGNAL_FUNC(arrow_fire_cb) NULL);
/*
board_signals[MOVE_SIGNAL]
= gtk_signal_new (“move“
GTK_RUN_FIRST
object_class->type
GTK_SIGNAL_OFFSET (BoardClass move)
gtk_marshal_NONE__INT_INT
GTK_TYPE_NONE 2
GTK_TYPE_INT GTK_TYPE_INT);
board_signals[FLIP_SIGNAL]
= gtk_signal_new (“flip“
GTK_RUN_FIRST
object_class->type
GTK_SIGNAL_OFFSET (BoardClass flip)
gtk_marshal_NONE__BOOL
GTK_TYPE_NONE 1
GTK_TYPE_BOOL);
gtk_object_class_add_signals (object_class
board_signals
LAST_SIGNAL);
*/
/*
board->squares[3][9] = WHITE;
board->squares[6][9] = WHITE;
board->squares[0][6] = WHITE;
board->squares[9][6] = WHITE;
board->squares[3][0] = BLACK;
board->squares[6][0] = BLACK;
board->squares[0][3] = BLACK;
board->squares[9][3] = BLACK;
*/
board->squares[9][3] = WHITE;
board->squares[9][6] = WHITE;
board->squares[6][0] = WHITE;
board->squares[6][9] = WHITE;
board->squares[0][3] = BLACK;
board->squares[0][6] = BLACK;
board->squares[3][0] = BLACK;
board->squares[3][9] = BLACK;
draw_board();
what_next = MOVE_WHITE_QUEEN;
}
static void
draw_a_line(GnomeCanvasGroup *group
int x1 int y1 int x2 int y2 char *color)
{
GnomeCanvasPoints *points;
/* allocate a new points array */
points = gnome_canvas_points_new (2);
/* fill out the points */
points->coords[0] = x1;
points->coords[1] = y1;
points->coords[2] = x2;
points->coords[3] = y2;
/* draw the line */
gnome_canvas_item_new(group
gnome_
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 142 2002-08-10 09:23 gamazons-0.70\acconfig.h
文件 25945 2002-08-10 09:23 gamazons-0.70\aclocal.m4
文件 0 2002-08-10 09:23 gamazons-0.70\AUTHORS
文件 439 2002-08-10 09:23 gamazons-0.70\autogen.sh
文件 0 2002-08-10 09:23 gamazons-0.70\ChangeLog
文件 3482 2002-08-10 09:23 gamazons-0.70\config.cache
文件 3809 2002-08-10 09:23 gamazons-0.70\config.h
文件 3560 2002-08-10 09:23 gamazons-0.70\config.h.in
文件 3015 2002-08-10 09:23 gamazons-0.70\config.log
文件 16799 2002-08-10 09:23 gamazons-0.70\config.status
文件 97150 2002-08-10 09:23 gamazons-0.70\configure
文件 626 2002-08-10 09:23 gamazons-0.70\configure.in
文件 0 2002-08-10 09:23 gamazons-0.70\COPYING
文件 14821 2002-08-10 09:23 gamazons-0.70\gamazons.glade
文件 14821 2002-08-10 09:23 gamazons-0.70\gamazons.glade.bak
文件 238 2002-08-10 09:23 gamazons-0.70\gamazons.gladep
文件 238 2002-08-10 09:23 gamazons-0.70\gamazons.gladep.bak
文件 0 2002-08-10 09:23 gamazons-0.70\INSTALL
文件 0 2002-08-10 09:23 gamazons-0.70\install-sh
文件 13424 2002-08-10 09:23 gamazons-0.70\Makefile
文件 664 2002-08-10 09:23 gamazons-0.70\Makefile.am
文件 12244 2002-08-10 09:23 gamazons-0.70\Makefile.in
文件 0 2002-08-10 09:23 gamazons-0.70\missing
文件 0 2002-08-10 09:23 gamazons-0.70\mkinstalldirs
文件 0 2002-08-10 09:23 gamazons-0.70\NEWS
文件 0 2002-08-10 09:23 gamazons-0.70\po\ChangeLog
文件 7167 2002-08-10 09:23 gamazons-0.70\po\Makefile
文件 7088 2002-08-10 09:23 gamazons-0.70\po\Makefile.in
文件 7126 2002-08-10 09:23 gamazons-0.70\po\Makefile.in.in
文件 79 2002-08-10 09:23 gamazons-0.70\po\POTFILES
............此处省略187个文件信息
- 上一篇:Mic4PC手机端源代码
- 下一篇:Qt.rar
相关资源
- AWS云计算实战(人民邮电出版社包含
- 登录亚马逊账户apk
- 天音亚马逊店铺商品批量复制采集软
- 深入了解亚马逊AWS云平台系列
- 亚马逊跨境电商运营宝典 老魏 著
- 中国个人卖家如何在亚马逊免费开店
- 亚马逊接口demo直接能跑起来
- 亚马逊MWS开发介绍
- Amazon亚马逊ASIN批量查类目关键词排名
- DeDRM_tools_6.5.4
- 美国亚马逊listing排名查询工具
- amazong 棋 亚马逊棋
- AWS+reInvent+2017+全球技术大会PPT
- Amazon 平台功能API
- 亚马逊跨境电商运营宝典(
- 亚马逊电商推进系统数据集
- 亚马逊棋Qt源代码和可执行程序
- 亚马逊音乐数据集
- 亚马逊衣服鞋子珠宝数据集
- 论文研究-亚马逊棋机器博弈系统中评
- 标签打印机打印亚马逊外箱FBA标签
- 小棋种-亚马逊棋-
- 亚马逊采集规则.ljobx
- 亚马逊云服务AWS Certified Solutions Arch
- AWS亚马逊SAA助理架构师最新题库中文
- AWS亚马逊SAA助理架构师最新题库中文
- AWS SAA 中文题库
- 亚马逊美食评论50万数据集(Amazon F
- 亚马逊国际站的商品图片及视频并保
- 亚马逊关键词工具
评论
共有 条评论