7 #include "random/random.h"
10 random_genmove(struct engine
*e
, struct board
*b
, enum stone color
)
13 board_play_random(b
, color
, &coord
, NULL
, NULL
);
14 if (!group_at(b
, coord
)) {
15 /* This was suicide. Just pass. */
16 /* XXX: We should check for non-suicide alternatives. */
20 return coord_copy(coord
);
24 engine_random_init(char *arg
)
26 struct engine
*e
= calloc(1, sizeof(struct engine
));
27 e
->name
= "RandomMove Engine";
28 e
->comment
= "I just make random moves. I won't pass as long as there is a place on the board where I can play. When we both pass, I will consider all the stones on the board alive.";
29 e
->genmove
= random_genmove
;
32 fprintf(stderr
, "Random: I support no engine arguments\n");