Initialize the trap table.

Initialize the trap table. More...


Files

file  win.c
 Check for wins - source file.
file  win_table.c
 Initialize the trap table - source file.
file  win_table.h
 Initialize the trap table - header file.

Functions

static int _add_word2 (W_ENTRY *word, int index)
 Add an entry to w_table2_1[].
static short _nextbit (short plain, int offset)
 Shift the next (from postion offset) on bit to the right most postion.
void w_init_1 (void)
 Initialize the trap table.

Variables

W_ENTRY w_table1_1 [LEN_WTABLE]
 One move away from a trap.
W_ENTRY w_table2_1 [LEN_WTABLE *4]
 Two moves away from a trap.

Detailed Description

Initialize the trap table.

Fill in w_table1_1[]. Each entry in Mem_FILE, as well as its three rotations, are added to w_table1_1[]. Four entries in w_table2_1[] are generated from one entry in w_table1_1[]. a_plain b_plain Each line in MEM_FILE is in the following format:

a_plain b_plain

where a_plain = stones that must be present for a first level trap. where b_plain = stones that must be empty for a first level trap.


Function Documentation

static int _add_word2 W_ENTRY word,
int  index
[static]
 

Add an entry to w_table2_1[].

Parameters:
word W_ENTRY * : entry to be added to w_table2_1[index].
index int : index into w_table2_1[].
Returns:
int : the next open index in w_table2_1[].
This results in 4 new entries in w_table2_1[].

static short _nextbit short  plain,
int  offset
[static]
 

Shift the next (from postion offset) on bit to the right most postion.

Parameters:
plain short : input plain.
offset int : first position to start at.
Returns:
short : plain rotated to the right so that the first on bit to the left of offset is now the right-most bit.

w_init_1 void   ) 
 

Initialize the trap table.

Returns:
void.


Variable Documentation

w_table1_1
 

One move away from a trap.

w_table2_1
 

Two moves away from a trap.


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