learn.c File Reference

Learn from a loss - source file. More...

#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <ctype.h>
#include <fcntl.h>
#include <malloc.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "assert.h"
#include "p_plain.h"
#include "score4.h"
#include "unmakemove.h"
#include "win_table.h"

Defines

#define P_LIMIT   0x8000
 Polynomial limit.
#define NTAB_SIZE   (NUM_PLAINS * 9)
 Size of n_table[] - (# of plains) x (# of permutations per trap).

Functions

static void _addentry (W_ENTRY *word)
 Add an entry to n_table[].
static void _exit (void)
 Add entries in n_table[] to MEM_FILE.
static int _find_c_move (short plain)
 Find move that results in a trap.
static void _init (void)
 Perform initialization for learn_1().
static void _permutations (int plain, W_ENTRY *word, int offset, int c_offset)
 Generate all valid trap permutations from a given trap.
static int _plain_win (short plain)
 Determine if a win is present in a plain.
static int _replay (W_ENTRY *word)
 Replay the game withing a plain.
void learn_1 (void)
 Learn from a loss.

Variables

short a_board_1 []
 Alpha board.
short b_board_1 []
 Beta board.
MOVE c_move_1
 Move chosen by Alpha.
MOVE o_move_1
 Move chosen by get_move(). Used by learn().
static W_ENTRY n_table [NTAB_SIZE+1]
 Table for new traps.
static int w_count
 W count.
static int a_stones
 A stones.
static int trap_found
 Was addentry() called?


Detailed Description

Learn from a loss - source file.

Author:
Stephen A. Broeker
Copyright (c) 1989 Stephen A. Broeker All Rights Reserved.
Generated on Sat Sep 24 09:00:12 2011 for ScoreFour by  doxygen 1.4.5