Utility to play a game of Score Four against a human.

Utility to play a game of Score Four against a human. More...


Files

file  score4.c
 Play a game of Score Four against a human - source file.

Defines

#define BUF_SIZE   512
 Buffer size.

Functions

static void _get_move (int move)
 Get the user's next move.
static void _info (int argc, char *argv[])
 Parse user supplied options.
static void _init (void)
 Perform initialization for Score Four.
static void _play (void)
 Referee a game of Score Four between computer and human.
static void _usage (void)
 Print usage message for Score Four.

Variables

static int user_first
 Does the user go first?
static int total_time
 Non-zero -> total time used to make moves.
static int max_time
 Maximum time used by heuristic to make moves.

Detailed Description

Utility to play a game of Score Four against a human.

The board is split into two boards - on each for Alpha and Beta. a_board_1 represents the moves made by Alpha. b_board_1 represents the moves made by Beta. There are NUM_PLAINS different plains in a cube. For Score4, each plain is (4 X 4), so each board is acutally an array of NUM_PLAINS shorts, with each move being one bit in a short. So the first move on a plain would be a value of 1. The second move, a value of 2, and so on. This board representation is redundant but it better facilitates the heuristics.

usage: score4 [-a] [-d] [-h] [-n] [-o] [-p] [-t 1|2] [-x] [-y]

-a : use aggression with polynomial.
-d : debug.
-h : don't display help message.
-n : computer gets first turn.
-o : user uses 'O's.
-p : apply polynomial heuristic.
-s : print time info on computer moves.
-t : apply trap heuristic (1 or 2).
-y : user gets first turn.
-x : user uses 'X's.


Define Documentation

#define BUF_SIZE   512
 

Buffer size.


Function Documentation

static void _get_move int  move  )  [static]
 

Get the user's next move.

Parameters:
move int : move in the game (0 - 63).
Returns:
void.

static void _info int  argc,
char *  argv[]
[static]
 

Parse user supplied options.

Parameters:
argc int : sizeof argv[].
argv char * [] : command line arguments.
Returns:
void.

static void _init void   )  [static]
 

Perform initialization for Score Four.

Returns:
void.

static void _play void   )  [static]
 

Referee a game of Score Four between computer and human.

Returns:
void.

static void _usage void   )  [static]
 

Print usage message for Score Four.

Returns:
void.


Variable Documentation

max_time [static]
 

Maximum time used by heuristic to make moves.

total_time [static]
 

Non-zero -> total time used to make moves.

user_first [static]
 

Does the user go first?


Generated on Sat Sep 24 09:00:12 2011 for ScoreFour by  doxygen 1.4.5