The reversi Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The reversi Reference Manual

This is the reversi Reference Manual, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 12:31:13 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

This is a Common Lisp implementation of the Reversi game.

The web site for this package is http://reversi.kpe.io which has
documentation for this package.

Reversi is based on the Othello(tm) game presented in Peter Norvig's
book "Paradigms of Artificial Intelligence Programming", chapter 18.
I highly suggest this book in general. If you wish to take full
advantage of this package, you should read the chapter referenced.

Quickstart
==========

First, you need to download and load ASDF -- the system definition loader.
It's home page is http://www.cliki.net/asdf. After downloading asdf.lisp, load it in your Lisp environment:
  (load "asdf.lisp")

Next, you need to load the Reversi ASDF definition file:
  (load "reversi.asd")

Next, load the Reversi program itself using ASDF:
  (asdf:operate 'asdf:load-op 'reversi)

If you are using AllegroCL, Lispworks, CMUCL, or SBCL with CLIM, you
can play Reversi with a graphical user interface using the command:
   (reversi:clim-reversi)

Otherwise, you can play in a text mode, such as:
   (reversi:reversi #'reversi:human (reversi:iago 1))


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 reversi

Source

reversi.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 reversi.asd

Location

reversi.asd

Systems

reversi (system)

Packages

reversi-system


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 reversi/package.lisp

Parent

reversi (system)

Location

package.lisp

Packages

reversi


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.3 reversi/utils.lisp

Dependency

package.lisp (file)

Parent

reversi (system)

Location

utils.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.4 reversi/base.lisp

Dependency

utils.lisp (file)

Parent

reversi (system)

Location

base.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.5 reversi/io.lisp

Dependency

base.lisp (file)

Parent

reversi (system)

Location

io.lisp

Exported Definitions

human (function)

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.6 reversi/edge-table.lisp

Dependency

io.lisp (file)

Parent

reversi (system)

Location

edge-table.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.7 reversi/edge-table-storage.lisp

Dependency

edge-table.lisp (file)

Parent

reversi (system)

Location

edge-table-storage.lisp

Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

3.1.8 reversi/strategies.lisp

Dependency

edge-table-storage.lisp (file)

Parent

reversi (system)

Location

strategies.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

4.1 reversi-system

Source

reversi.asd

Use List

Previous: , Up: Packages   [Contents][Index]

4.2 reversi

Source

package.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Functions

Function: alpha-beta-searcher DEPTH EVAL-FN

A strategy that searches to DEPTH and then uses EVAL-FN.

Package

reversi

Source

strategies.lisp (file)

Function: alpha-beta-searcher2 DEPTH EVAL-FN

Return a strategy that does A-B search with sorted moves.

Package

reversi

Source

strategies.lisp (file)

Function: alpha-beta-searcher3 DEPTH EVAL-FN

Return a strategy that does A-B search with killer moves.

Package

reversi

Source

strategies.lisp (file)

Function: count-difference PLAYER BOARD

Count player’s pieces minus opponent’s pieces.

Package

reversi

Source

base.lisp (file)

Function: human PLAYER BOARD

A human player for the game of Reversi

Package

reversi

Source

io.lisp (file)

Function: iago DEPTH

Use an approximation of Iago’s evaluation function.

Package

reversi

Source

strategies.lisp (file)

Function: modified-weighted-squares PLAYER BOARD

Like WEIGHTED-SQUARES, but don’t take off for moving near an occupied corner.

Package

reversi

Source

strategies.lisp (file)

Function: random-reversi-series STRATEGY1 STRATEGY2 N-PAIRS &optional N-RANDOM

Play a series of 2*n games, starting from a random position.

Package

reversi

Source

base.lisp (file)

Function: reversi BL-STRATEGY WH-STRATEGY &optional PRINT MINUTES
Package

reversi

Source

base.lisp (file)

Function: reversi-series STRATEGY1 STRATEGY2 N-PAIRS

Play a series of 2*n-pairs games, swapping sides.

Package

reversi

Source

base.lisp (file)

Function: round-robin STRATEGIES N-PAIRS &optional N-RANDOM NAMES

Play a tournament among the strategies.
N-PAIRS = games each strategy plays as each color against each opponent. So with N strategies, a total of N*(N-1)*N-PAIRS games are played.

Package

reversi

Source

base.lisp (file)

Function: text-reversi ()
Package

reversi

Source

strategies.lisp (file)

Function: weighted-squares PLAYER BOARD

Sum of the weights of player’s squares minus opponent’s.

Package

reversi

Source

strategies.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Constants

Constant: +default-max-minutes+
Package

reversi

Source

base.lisp (file)

Constant: black

A black piece

Package

reversi

Source

base.lisp (file)

Constant: empty

An empty square

Package

reversi

Source

base.lisp (file)

Constant: losing-value
Package

reversi

Source

strategies.lisp (file)

Constant: outer

Marks squares outside the 8x8 board

Package

reversi

Source

base.lisp (file)

Constant: white

A white piece

Package

reversi

Source

base.lisp (file)

Constant: winning-value
Package

reversi

Source

strategies.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Special variables

Special Variable: *board*

A copy of the game board

Package

reversi

Source

base.lisp (file)

Special Variable: *clock*

A copy of the game clock

Package

reversi

Source

base.lisp (file)

Special Variable: *edge-and-x-lists*

The four edges (with their X-squares).

Package

reversi

Source

edge-table.lisp (file)

Special Variable: *edge-table*

Array of values to player-to-move for edge positions.

Package

reversi

Source

edge-table.lisp (file)

Special Variable: *et-path*
Package

reversi

Source

edge-table-storage.lisp (file)

Special Variable: *move-number*

The number of the move to be played

Package

reversi

Source

base.lisp (file)

Special Variable: *ply-boards*
Package

reversi

Source

base.lisp (file)

Special Variable: *static-edge-table*
Package

reversi

Source

edge-table.lisp (file)

Special Variable: *top-edge*
Package

reversi

Source

edge-table.lisp (file)

Special Variable: *weights*
Package

reversi

Source

strategies.lisp (file)

Special Variable: +all-directions+
Package

reversi

Source

base.lisp (file)

Special Variable: all-squares

A list of all squares

Package

reversi

Source

base.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Macros

Macro: aif TEST THEN &optional ELSE
Package

reversi

Source

utils.lisp (file)

Macro: awhen TEST-FORM &body BODY
Package

reversi

Source

utils.lisp (file)

Macro: awhile EXPR &body BODY
Package

reversi

Source

utils.lisp (file)

Macro: bref BOARD SQUARE
Package

reversi

Source

base.lisp (file)

Macro: missing-argument ()
Package

reversi

Source

utils.lisp (file)

Macro: opponent PLAYER
Package

reversi

Source

base.lisp (file)

Macro: until TEST &body BODY
Package

reversi

Source

utils.lisp (file)

Macro: while TEST &body BODY
Package

reversi

Source

utils.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.4 Functions

Function: 88->h8 NUM

Convert from numeric to alphanumeric square notation.

Package

reversi

Source

io.lisp (file)

Function: ab3-df PLY
Package

reversi

Source

strategies.lisp (file)

Function: ab3-md-wt PLY
Package

reversi

Source

strategies.lisp (file)

Function: ab3-wt PLY
Package

reversi

Source

strategies.lisp (file)

Function: ab3w-df PLY
Package

reversi

Source

strategies.lisp (file)

Function: ab3w-md-wt PLY
Package

reversi

Source

strategies.lisp (file)

Function: ab3w-wt PLY
Package

reversi

Source

strategies.lisp (file)

Function: alpha-beta PLAYER BOARD ACHIEVABLE CUTOFF PLY EVAL-FN

Find the best move, for PLAYER, according to EVAL-FN, searching PLY levels deep and backing up values, using cutoffs whenever possible.

Package

reversi

Source

strategies.lisp (file)

Function: alpha-beta-searcher3w DEPTH EVAL-FN

Return a strategy that does A-B search with killer moves.

Package

reversi

Source

strategies.lisp (file)

Function: alpha-beta2 PLAYER NODE ACHIEVABLE CUTOFF PLY EVAL-FN

A-B search, sorting moves by eval-fn

Package

reversi

Source

strategies.lisp (file)

Function: alpha-beta3 PLAYER BOARD ACHIEVABLE CUTOFF PLY EVAL-FN KILLER

A-B search, putting killer move first.

Package

reversi

Source

strategies.lisp (file)

Function: alpha-beta3w PLAYER BOARD ACHIEVABLE CUTOFF PLY EVAL-FN KILLER

A-B search, putting killer move first.

Package

reversi

Source

strategies.lisp (file)

Function: any-legal-move? PLAYER BOARD

Does player have any legal moves in this position?

Package

reversi

Source

base.lisp (file)

Function: combine-edge-moves POSSIBILITIES PLAYER

Combine the best moves.

Package

reversi

Source

edge-table.lisp (file)

Function: concat-symbol &rest ARGS

Concatenate symbols or strings to form an interned symbol

Package

reversi

Source

utils.lisp (file)

Function: copy-board BOARD
Package

reversi

Source

base.lisp (file)

Function: copy-node INSTANCE
Package

reversi

Source

strategies.lisp (file)

Function: copy-state INSTANCE
Package

reversi

Source

base.lisp (file)

Function: corner-for XSQ
Package

reversi

Source

edge-table.lisp (file)

Function: corner-p SQ
Package

reversi

Source

edge-table.lisp (file)

Function: count-edge-neighbors PLAYER BOARD SQUARE

Count the neighbors of this square occupied by player.

Package

reversi

Source

edge-table.lisp (file)

Function: cross-product FN XLIST YLIST

Return a list of all (fn x y) values.

Package

reversi

Source

utils.lisp (file)

Function: edge-index PLAYER BOARD SQUARES

The index counts 1 for player; 2 for opponent, on each square—summed as a base 3 number.

Package

reversi

Source

edge-table.lisp (file)

Function: edge-move-probability PLAYER BOARD SQUARE

What’s the probability that player can move to this square?

Package

reversi

Source

edge-table.lisp (file)

Function: edge-stability PLAYER BOARD

Total edge evaluation for player to move on board.

Package

reversi

Source

strategies.lisp (file)

Function: final-value PLAYER BOARD

Is this a win, loss, or draw for player?

Package

reversi

Source

strategies.lisp (file)

Function: final-value-weighted PLAYER BOARD

Is this a win, loss, or draw for player?

Package

reversi

Source

strategies.lisp (file)

Function: find-bracketing-piece SQUARE PLAYER BOARD DIR

Return the square number of the bracketing piece.

Package

reversi

Source

base.lisp (file)

Function: get-move GAME STRATEGY PLAYER BOARD PRINT CLOCK

Call the player’s strategy function to get a move. Keep calling until a legal move is made.

Package

reversi

Source

base.lisp (file)

Function: h8->88 STR

Convert from alphanumeric to numeric square notation.

Package

reversi

Source

io.lisp (file)

Function: iago-eval PLAYER BOARD

Combine edge-stability, current mobility and potential mobility to arrive at an evaluation.

Package

reversi

Source

strategies.lisp (file)

Function: init-edge-table ()

Initialize *edge-table*, starting from the empty board.

Package

reversi

Source

edge-table.lisp (file)

Function: initial-board ()

Return a board, empty except for four pieces in the middle.

Package

reversi

Source

base.lisp (file)

Function: legal-moves PLAYER BOARD

Returns a list of legal moves for player

Package

reversi

Source

base.lisp (file)

Function: legal-nodes PLAYER BOARD EVAL-FN

Return a list of legal moves, each one packed into a node.

Package

reversi

Source

strategies.lisp (file)

Function: legal-p MOVE PLAYER BOARD

A Legal move must be into an empty square, and it must flip at least one opponent piece.

Package

reversi

Source

base.lisp (file)

Function: list-to-delimited-string LIST &optional SEPARATOR
Package

reversi

Source

utils.lisp (file)

Function: load-edge-table &optional PATH
Package

reversi

Source

edge-table-storage.lisp (file)

Function: make-edge-table ()
Package

reversi

Source

edge-table.lisp (file)

Function: make-flips MOVE PLAYER BOARD DIR

Make any flips in the given direction.

Package

reversi

Source

base.lisp (file)

Function: make-game BL-STRATEGY WH-STRATEGY &key PRINT MINUTES RECORD-GAME
Package

reversi

Source

base.lisp (file)

Function: make-game-move GAME MOVE PLAYER
Package

reversi

Source

base.lisp (file)

Function: make-move MOVE PLAYER BOARD

Update board to reflect move by player

Package

reversi

Source

base.lisp (file)

Function: make-moves ()
Package

reversi

Source

base.lisp (file)

Function: make-node &key (SQUARE SQUARE) (BOARD BOARD) (VALUE VALUE)
Package

reversi

Source

strategies.lisp (file)

Function: make-state MOVE PLAYER CLOCK BOARD
Package

reversi

Source

base.lisp (file)

Function: make-state-struct &key (MOVE MOVE) (PLAYER PLAYER) (BOARD BOARD) (CLOCK CLOCK)
Package

reversi

Source

base.lisp (file)

Function: map-edge-n-pieces FN PLAYER BOARD N SQUARES INDEX

Call fn on all edges with n pieces.

Package

reversi

Source

edge-table.lisp (file)

Function: mappend FN LIST

Append the results of calling fn on each element of list. Like mapcon, but uses append instead of nconc.

Package

reversi

Source

utils.lisp (file)

Function: maximize-difference PLAYER BOARD

A strategy that maximizes the difference in pieces.

Package

reversi

Source

strategies.lisp (file)

Function: maximizer EVAL-FN

Return a strategy that will consider every legal move, apply EVAL-FN to each resulting board, and choose the move for which EVAL-FN returns the best score. FN takes two arguments: the player-to-move and board

Package

reversi

Source

strategies.lisp (file)

Function: minimax PLAYER BOARD PLY EVAL-FN

Find the best move, for PLAYER, according to EVAL-FN, searching PLY levels deep and backing up values.

Package

reversi

Source

strategies.lisp (file)

Function: minimax-searcher PLY EVAL-FN

A strategy that searches PLY levels and then uses EVAL-FN.

Package

reversi

Source

strategies.lisp (file)

Function: mm-df PLY
Package

reversi

Source

strategies.lisp (file)

Function: mm-md-wt PLY
Package

reversi

Source

strategies.lisp (file)

Function: mm-wt PLY
Package

reversi

Source

strategies.lisp (file)

Function: mobility PLAYER BOARD

Current Mobility is the number of legal moves. Potential mobility is the number of blank squares adjacent to an opponent that are not legal moves. Returns current and potential mobility for player.

Package

reversi

Source

strategies.lisp (file)

Function: mobility-simple PLAYER BOARD

The number of moves a player has.

Package

reversi

Source

strategies.lisp (file)

Function: moves-to-string MOVES
Package

reversi

Source

io.lisp (file)

Function: mx-df ()
Package

reversi

Source

strategies.lisp (file)

Function: mx-md-wt ()
Package

reversi

Source

strategies.lisp (file)

Function: mx-wt ()
Package

reversi

Source

strategies.lisp (file)

Function: name-of PIECE
Package

reversi

Source

base.lisp (file)

Function: negate-value NODE

Set the value of a node to its negative.

Package

reversi

Source

strategies.lisp (file)

Function: neighbors SQUARE

Return a list of all squares adjacent to a square.

Package

reversi

Source

strategies.lisp (file)

Function: next-to-play BOARD PREVIOUS-PLAYER &optional PRINT

Compute the player to move next, or NIL if nobody can move.

Package

reversi

Source

base.lisp (file)

Function: node-board INSTANCE
Function: (setf node-board) VALUE INSTANCE
Package

reversi

Source

strategies.lisp (file)

Function: node-p OBJECT
Package

reversi

Source

strategies.lisp (file)

Function: node-square INSTANCE
Function: (setf node-square) VALUE INSTANCE
Package

reversi

Source

strategies.lisp (file)

Function: node-value INSTANCE
Function: (setf node-value) VALUE INSTANCE
Package

reversi

Source

strategies.lisp (file)

Function: piece-stability BOARD SQ
Package

reversi

Source

edge-table.lisp (file)

Function: play-game GAME
Package

reversi

Source

base.lisp (file)

Function: possible-edge-move PLAYER BOARD SQ

Return a (prob val) pair for a possible edge move.

Package

reversi

Source

edge-table.lisp (file)

Function: possible-edge-moves-value PLAYER BOARD INDEX

Consider all possible edge moves. Combine their values into a single number.

Package

reversi

Source

edge-table.lisp (file)

Function: print-board &optional BOARD CLOCK

Print a board, along with some statistics.

Package

reversi

Source

io.lisp (file)

Function: put-first KILLER MOVES

Move the killer move to the front of moves, if the killer move is in fact a legal move.

Package

reversi

Source

strategies.lisp (file)

Function: random-nth LIST

Pick a random element out of a list.

Package

reversi

Source

utils.lisp (file)

Function: random-strategy PLAYER BOARD

Make any legal move.

Package

reversi

Source

strategies.lisp (file)

Function: replace-board TO FROM
Package

reversi

Source

base.lisp (file)

Function: reset-game GAME &optional MOVE-NUMBER
Package

reversi

Source

base.lisp (file)

Function: rr PLY N-PAIRS
Package

reversi

Source

strategies.lisp (file)

Function: some-neighbors BOARD OPP NEIGHBORS
Package

reversi

Source

strategies.lisp (file)

Function: state-board INSTANCE
Function: (setf state-board) VALUE INSTANCE
Package

reversi

Source

base.lisp (file)

Function: state-clock INSTANCE
Function: (setf state-clock) VALUE INSTANCE
Package

reversi

Source

base.lisp (file)

Function: state-move INSTANCE
Function: (setf state-move) VALUE INSTANCE
Package

reversi

Source

base.lisp (file)

Function: state-p OBJECT
Package

reversi

Source

base.lisp (file)

Function: state-player INSTANCE
Function: (setf state-player) VALUE INSTANCE
Package

reversi

Source

base.lisp (file)

Function: static-edge-stability PLAYER BOARD

Compute this edge’s static stability

Package

reversi

Source

edge-table.lisp (file)

Function: store-edge-table ET &optional PATH
Package

reversi

Source

edge-table-storage.lisp (file)

Function: switch-strategies STRATEGY1 M STRATEGY2

Make a new strategy that plays strategy1 for m moves, then plays according to strategy2.

Package

reversi

Source

base.lisp (file)

Function: time-string TIME

Return a string representing this internal time in min:secs.

Package

reversi

Source

io.lisp (file)

Function: title-of PIECE
Package

reversi

Source

base.lisp (file)

Function: valid-p MOVE

Valid moves are numbers in the range 11-88 that end in 1-8.

Package

reversi

Source

base.lisp (file)

Function: would-flip? MOVE PLAYER BOARD DIR

Would this move result in any flips in this direction? If so, return the square number of the bracketing piece.

Package

reversi

Source

base.lisp (file)

Function: x-square-for CORNER
Package

reversi

Source

edge-table.lisp (file)

Function: x-square-p SQ
Package

reversi

Source

edge-table.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.5 Generic functions

Generic Function: bl-strategy OBJECT
Package

reversi

Methods
Method: bl-strategy (REVERSI-GAME reversi-game)

Strategy function for black

Source

base.lisp (file)

Generic Function: board OBJECT
Package

reversi

Methods
Method: board (REVERSI-GAME reversi-game)

The board configuration

Source

base.lisp (file)

Generic Function: clock OBJECT
Generic Function: (setf clock) NEW-VALUE OBJECT
Package

reversi

Methods
Method: clock (REVERSI-GAME reversi-game)
Method: (setf clock) NEW-VALUE (REVERSI-GAME reversi-game)

An array of time-units left

Source

base.lisp (file)

Generic Function: final-result OBJECT
Generic Function: (setf final-result) NEW-VALUE OBJECT
Package

reversi

Methods
Method: final-result (REVERSI-GAME reversi-game)
Method: (setf final-result) NEW-VALUE (REVERSI-GAME reversi-game)

Final count, is NIL while game in play

Source

base.lisp (file)

Generic Function: make-clock CLOCK
Package

reversi

Source

base.lisp (file)

Methods
Method: make-clock (MINUTES integer)
Method: make-clock (CLOCK array)
Generic Function: max-minutes OBJECT
Package

reversi

Methods
Method: max-minutes (REVERSI-GAME reversi-game)

Maximum minites for each player

Source

base.lisp (file)

Generic Function: move-number OBJECT
Generic Function: (setf move-number) NEW-VALUE OBJECT
Package

reversi

Methods
Method: move-number (REVERSI-GAME reversi-game)
Method: (setf move-number) NEW-VALUE (REVERSI-GAME reversi-game)

The number of the move to be played

Source

base.lisp (file)

Generic Function: moves OBJECT
Generic Function: (setf moves) NEW-VALUE OBJECT
Package

reversi

Methods
Method: moves (REVERSI-GAME reversi-game)
Method: (setf moves) NEW-VALUE (REVERSI-GAME reversi-game)

An array of moves played in the game

Source

base.lisp (file)

Generic Function: player OBJECT
Generic Function: (setf player) NEW-VALUE OBJECT
Package

reversi

Methods
Method: player (REVERSI-GAME reversi-game)
Method: (setf player) NEW-VALUE (REVERSI-GAME reversi-game)

ID of next player to move

Source

base.lisp (file)

Generic Function: print? OBJECT
Package

reversi

Methods
Method: print? (REVERSI-GAME reversi-game)

Whether to print progress of this game

Source

base.lisp (file)

Generic Function: record-game? OBJECT
Package

reversi

Methods
Method: record-game? (REVERSI-GAME reversi-game)

Whether to record moves and clcck of this game

Source

base.lisp (file)

Generic Function: wh-strategy OBJECT
Package

reversi

Methods
Method: wh-strategy (REVERSI-GAME reversi-game)

Strategy function for white

Source

base.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.6 Structures

Structure: node ()
Package

reversi

Source

strategies.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: square
Type

reversi::square

Initform

(reversi::missing-argument)

Readers

node-square (function)

Writers

(setf node-square) (function)

Slot: board
Type

reversi::board

Initform

(reversi::missing-argument)

Readers

node-board (function)

Writers

(setf node-board) (function)

Slot: value
Type

integer

Initform

(reversi::missing-argument)

Readers

node-value (function)

Writers

(setf node-value) (function)

Structure: state ()
Package

reversi

Source

base.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: move
Readers

state-move (function)

Writers

(setf state-move) (function)

Slot: player
Readers

state-player (function)

Writers

(setf state-player) (function)

Slot: board
Readers

state-board (function)

Writers

(setf state-board) (function)

Slot: clock
Readers

state-clock (function)

Writers

(setf state-clock) (function)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.7 Classes

Class: reversi-game ()
Package

reversi

Source

base.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: bl-strategy

Strategy function for black

Initargs

:bl-strategy

Readers

bl-strategy (generic function)

Slot: wh-strategy

Strategy function for white

Initargs

:wh-strategy

Readers

wh-strategy (generic function)

Slot: board

The board configuration

Type

reversi::board

Initargs

:board

Readers

board (generic function)

Slot: move-number

The number of the move to be played

Type

fixnum

Initargs

:move-number

Readers

move-number (generic function)

Writers

(setf move-number) (generic function)

Slot: player

ID of next player to move

Type

reversi::player

Initargs

:player

Readers

player (generic function)

Writers

(setf player) (generic function)

Slot: moves

An array of moves played in the game

Type

reversi::moves

Initargs

:moves

Readers

moves (generic function)

Writers

(setf moves) (generic function)

Slot: print?

Whether to print progress of this game

Type

boolean

Initargs

:print?

Readers

print? (generic function)

Slot: record-game?

Whether to record moves and clcck of this game

Type

boolean

Initargs

:record-game?

Readers

record-game? (generic function)

Slot: final-result

Final count, is NIL while game in play

Type

(or null fixnum)

Initargs

:final-result

Readers

final-result (generic function)

Writers

(setf final-result) (generic function)

Slot: max-minutes

Maximum minites for each player

Type

fixnum

Initargs

:max-minutes

Readers

max-minutes (generic function)

Slot: clock

An array of time-units left

Type

reversi::clock

Initargs

:clock

Readers

clock (generic function)

Writers

(setf clock) (generic function)

Direct Default Initargs
InitargValue
:bl-strategynil
:wh-strategynil
:board(reversi::initial-board)
:move-number1
:playerreversi::black
:moves(reversi::make-moves)
:print?nil
:record-game?nil
:final-resultnil
:max-minutesreversi::+default-max-minutes+
:clock(reversi::make-clock reversi::+default-max-minutes+)

Previous: , Up: Internal definitions   [Contents][Index]

5.2.8 Types

Type: board ()
Package

reversi

Source

base.lisp (file)

Type: clock ()
Package

reversi

Source

base.lisp (file)

Type: dir ()
Package

reversi

Source

base.lisp (file)

Type: edge-table ()
Package

reversi

Source

edge-table.lisp (file)

Type: move ()
Package

reversi

Source

base.lisp (file)

Type: moves ()
Package

reversi

Source

base.lisp (file)

Type: piece ()
Package

reversi

Source

base.lisp (file)

Type: player ()
Package

reversi

Source

base.lisp (file)

Type: square ()
Package

reversi

Source

base.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   R  
Index Entry  Section

F
File, Lisp, reversi.asd: The reversi<dot>asd file
File, Lisp, reversi/base.lisp: The reversi/base<dot>lisp file
File, Lisp, reversi/edge-table-storage.lisp: The reversi/edge-table-storage<dot>lisp file
File, Lisp, reversi/edge-table.lisp: The reversi/edge-table<dot>lisp file
File, Lisp, reversi/io.lisp: The reversi/io<dot>lisp file
File, Lisp, reversi/package.lisp: The reversi/package<dot>lisp file
File, Lisp, reversi/strategies.lisp: The reversi/strategies<dot>lisp file
File, Lisp, reversi/utils.lisp: The reversi/utils<dot>lisp file

L
Lisp File, reversi.asd: The reversi<dot>asd file
Lisp File, reversi/base.lisp: The reversi/base<dot>lisp file
Lisp File, reversi/edge-table-storage.lisp: The reversi/edge-table-storage<dot>lisp file
Lisp File, reversi/edge-table.lisp: The reversi/edge-table<dot>lisp file
Lisp File, reversi/io.lisp: The reversi/io<dot>lisp file
Lisp File, reversi/package.lisp: The reversi/package<dot>lisp file
Lisp File, reversi/strategies.lisp: The reversi/strategies<dot>lisp file
Lisp File, reversi/utils.lisp: The reversi/utils<dot>lisp file

R
reversi.asd: The reversi<dot>asd file
reversi/base.lisp: The reversi/base<dot>lisp file
reversi/edge-table-storage.lisp: The reversi/edge-table-storage<dot>lisp file
reversi/edge-table.lisp: The reversi/edge-table<dot>lisp file
reversi/io.lisp: The reversi/io<dot>lisp file
reversi/package.lisp: The reversi/package<dot>lisp file
reversi/strategies.lisp: The reversi/strategies<dot>lisp file
reversi/utils.lisp: The reversi/utils<dot>lisp file

Jump to:   F   L   R  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (   8  
A   B   C   E   F   G   H   I   L   M   N   O   P   R   S   T   U   V   W   X  
Index Entry  Section

(
(setf clock): Internal generic functions
(setf clock): Internal generic functions
(setf final-result): Internal generic functions
(setf final-result): Internal generic functions
(setf move-number): Internal generic functions
(setf move-number): Internal generic functions
(setf moves): Internal generic functions
(setf moves): Internal generic functions
(setf node-board): Internal functions
(setf node-square): Internal functions
(setf node-value): Internal functions
(setf player): Internal generic functions
(setf player): Internal generic functions
(setf state-board): Internal functions
(setf state-clock): Internal functions
(setf state-move): Internal functions
(setf state-player): Internal functions

8
88->h8: Internal functions

A
ab3-df: Internal functions
ab3-md-wt: Internal functions
ab3-wt: Internal functions
ab3w-df: Internal functions
ab3w-md-wt: Internal functions
ab3w-wt: Internal functions
aif: Internal macros
alpha-beta: Internal functions
alpha-beta-searcher: Exported functions
alpha-beta-searcher2: Exported functions
alpha-beta-searcher3: Exported functions
alpha-beta-searcher3w: Internal functions
alpha-beta2: Internal functions
alpha-beta3: Internal functions
alpha-beta3w: Internal functions
any-legal-move?: Internal functions
awhen: Internal macros
awhile: Internal macros

B
bl-strategy: Internal generic functions
bl-strategy: Internal generic functions
board: Internal generic functions
board: Internal generic functions
bref: Internal macros

C
clock: Internal generic functions
clock: Internal generic functions
combine-edge-moves: Internal functions
concat-symbol: Internal functions
copy-board: Internal functions
copy-node: Internal functions
copy-state: Internal functions
corner-for: Internal functions
corner-p: Internal functions
count-difference: Exported functions
count-edge-neighbors: Internal functions
cross-product: Internal functions

E
edge-index: Internal functions
edge-move-probability: Internal functions
edge-stability: Internal functions

F
final-result: Internal generic functions
final-result: Internal generic functions
final-value: Internal functions
final-value-weighted: Internal functions
find-bracketing-piece: Internal functions
Function, (setf node-board): Internal functions
Function, (setf node-square): Internal functions
Function, (setf node-value): Internal functions
Function, (setf state-board): Internal functions
Function, (setf state-clock): Internal functions
Function, (setf state-move): Internal functions
Function, (setf state-player): Internal functions
Function, 88->h8: Internal functions
Function, ab3-df: Internal functions
Function, ab3-md-wt: Internal functions
Function, ab3-wt: Internal functions
Function, ab3w-df: Internal functions
Function, ab3w-md-wt: Internal functions
Function, ab3w-wt: Internal functions
Function, alpha-beta: Internal functions
Function, alpha-beta-searcher: Exported functions
Function, alpha-beta-searcher2: Exported functions
Function, alpha-beta-searcher3: Exported functions
Function, alpha-beta-searcher3w: Internal functions
Function, alpha-beta2: Internal functions
Function, alpha-beta3: Internal functions
Function, alpha-beta3w: Internal functions
Function, any-legal-move?: Internal functions
Function, combine-edge-moves: Internal functions
Function, concat-symbol: Internal functions
Function, copy-board: Internal functions
Function, copy-node: Internal functions
Function, copy-state: Internal functions
Function, corner-for: Internal functions
Function, corner-p: Internal functions
Function, count-difference: Exported functions
Function, count-edge-neighbors: Internal functions
Function, cross-product: Internal functions
Function, edge-index: Internal functions
Function, edge-move-probability: Internal functions
Function, edge-stability: Internal functions
Function, final-value: Internal functions
Function, final-value-weighted: Internal functions
Function, find-bracketing-piece: Internal functions
Function, get-move: Internal functions
Function, h8->88: Internal functions
Function, human: Exported functions
Function, iago: Exported functions
Function, iago-eval: Internal functions
Function, init-edge-table: Internal functions
Function, initial-board: Internal functions
Function, legal-moves: Internal functions
Function, legal-nodes: Internal functions
Function, legal-p: Internal functions
Function, list-to-delimited-string: Internal functions
Function, load-edge-table: Internal functions
Function, make-edge-table: Internal functions
Function, make-flips: Internal functions
Function, make-game: Internal functions
Function, make-game-move: Internal functions
Function, make-move: Internal functions
Function, make-moves: Internal functions
Function, make-node: Internal functions
Function, make-state: Internal functions
Function, make-state-struct: Internal functions
Function, map-edge-n-pieces: Internal functions
Function, mappend: Internal functions
Function, maximize-difference: Internal functions
Function, maximizer: Internal functions
Function, minimax: Internal functions
Function, minimax-searcher: Internal functions
Function, mm-df: Internal functions
Function, mm-md-wt: Internal functions
Function, mm-wt: Internal functions
Function, mobility: Internal functions
Function, mobility-simple: Internal functions
Function, modified-weighted-squares: Exported functions
Function, moves-to-string: Internal functions
Function, mx-df: Internal functions
Function, mx-md-wt: Internal functions
Function, mx-wt: Internal functions
Function, name-of: Internal functions
Function, negate-value: Internal functions
Function, neighbors: Internal functions
Function, next-to-play: Internal functions
Function, node-board: Internal functions
Function, node-p: Internal functions
Function, node-square: Internal functions
Function, node-value: Internal functions
Function, piece-stability: Internal functions
Function, play-game: Internal functions
Function, possible-edge-move: Internal functions
Function, possible-edge-moves-value: Internal functions
Function, print-board: Internal functions
Function, put-first: Internal functions
Function, random-nth: Internal functions
Function, random-reversi-series: Exported functions
Function, random-strategy: Internal functions
Function, replace-board: Internal functions
Function, reset-game: Internal functions
Function, reversi: Exported functions
Function, reversi-series: Exported functions
Function, round-robin: Exported functions
Function, rr: Internal functions
Function, some-neighbors: Internal functions
Function, state-board: Internal functions
Function, state-clock: Internal functions
Function, state-move: Internal functions
Function, state-p: Internal functions
Function, state-player: Internal functions
Function, static-edge-stability: Internal functions
Function, store-edge-table: Internal functions
Function, switch-strategies: Internal functions
Function, text-reversi: Exported functions
Function, time-string: Internal functions
Function, title-of: Internal functions
Function, valid-p: Internal functions
Function, weighted-squares: Exported functions
Function, would-flip?: Internal functions
Function, x-square-for: Internal functions
Function, x-square-p: Internal functions

G
Generic Function, (setf clock): Internal generic functions
Generic Function, (setf final-result): Internal generic functions
Generic Function, (setf move-number): Internal generic functions
Generic Function, (setf moves): Internal generic functions
Generic Function, (setf player): Internal generic functions
Generic Function, bl-strategy: Internal generic functions
Generic Function, board: Internal generic functions
Generic Function, clock: Internal generic functions
Generic Function, final-result: Internal generic functions
Generic Function, make-clock: Internal generic functions
Generic Function, max-minutes: Internal generic functions
Generic Function, move-number: Internal generic functions
Generic Function, moves: Internal generic functions
Generic Function, player: Internal generic functions
Generic Function, print?: Internal generic functions
Generic Function, record-game?: Internal generic functions
Generic Function, wh-strategy: Internal generic functions
get-move: Internal functions

H
h8->88: Internal functions
human: Exported functions

I
iago: Exported functions
iago-eval: Internal functions
init-edge-table: Internal functions
initial-board: Internal functions

L
legal-moves: Internal functions
legal-nodes: Internal functions
legal-p: Internal functions
list-to-delimited-string: Internal functions
load-edge-table: Internal functions

M
Macro, aif: Internal macros
Macro, awhen: Internal macros
Macro, awhile: Internal macros
Macro, bref: Internal macros
Macro, missing-argument: Internal macros
Macro, opponent: Internal macros
Macro, until: Internal macros
Macro, while: Internal macros
make-clock: Internal generic functions
make-clock: Internal generic functions
make-clock: Internal generic functions
make-edge-table: Internal functions
make-flips: Internal functions
make-game: Internal functions
make-game-move: Internal functions
make-move: Internal functions
make-moves: Internal functions
make-node: Internal functions
make-state: Internal functions
make-state-struct: Internal functions
map-edge-n-pieces: Internal functions
mappend: Internal functions
max-minutes: Internal generic functions
max-minutes: Internal generic functions
maximize-difference: Internal functions
maximizer: Internal functions
Method, (setf clock): Internal generic functions
Method, (setf final-result): Internal generic functions
Method, (setf move-number): Internal generic functions
Method, (setf moves): Internal generic functions
Method, (setf player): Internal generic functions
Method, bl-strategy: Internal generic functions
Method, board: Internal generic functions
Method, clock: Internal generic functions
Method, final-result: Internal generic functions
Method, make-clock: Internal generic functions
Method, make-clock: Internal generic functions
Method, max-minutes: Internal generic functions
Method, move-number: Internal generic functions
Method, moves: Internal generic functions
Method, player: Internal generic functions
Method, print?: Internal generic functions
Method, record-game?: Internal generic functions
Method, wh-strategy: Internal generic functions
minimax: Internal functions
minimax-searcher: Internal functions
missing-argument: Internal macros
mm-df: Internal functions
mm-md-wt: Internal functions
mm-wt: Internal functions
mobility: Internal functions
mobility-simple: Internal functions
modified-weighted-squares: Exported functions
move-number: Internal generic functions
move-number: Internal generic functions
moves: Internal generic functions
moves: Internal generic functions
moves-to-string: Internal functions
mx-df: Internal functions
mx-md-wt: Internal functions
mx-wt: Internal functions

N
name-of: Internal functions
negate-value: Internal functions
neighbors: Internal functions
next-to-play: Internal functions
node-board: Internal functions
node-p: Internal functions
node-square: Internal functions
node-value: Internal functions

O
opponent: Internal macros

P
piece-stability: Internal functions
play-game: Internal functions
player: Internal generic functions
player: Internal generic functions
possible-edge-move: Internal functions
possible-edge-moves-value: Internal functions
print-board: Internal functions
print?: Internal generic functions
print?: Internal generic functions
put-first: Internal functions

R
random-nth: Internal functions
random-reversi-series: Exported functions
random-strategy: Internal functions
record-game?: Internal generic functions
record-game?: Internal generic functions
replace-board: Internal functions
reset-game: Internal functions
reversi: Exported functions
reversi-series: Exported functions
round-robin: Exported functions
rr: Internal functions

S
some-neighbors: Internal functions
state-board: Internal functions
state-clock: Internal functions
state-move: Internal functions
state-p: Internal functions
state-player: Internal functions
static-edge-stability: Internal functions
store-edge-table: Internal functions
switch-strategies: Internal functions

T
text-reversi: Exported functions
time-string: Internal functions
title-of: Internal functions

U
until: Internal macros

V
valid-p: Internal functions

W
weighted-squares: Exported functions
wh-strategy: Internal generic functions
wh-strategy: Internal generic functions
while: Internal macros
would-flip?: Internal functions

X
x-square-for: Internal functions
x-square-p: Internal functions

Jump to:   (   8  
A   B   C   E   F   G   H   I   L   M   N   O   P   R   S   T   U   V   W   X  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *   +  
A   B   C   E   F   L   M   O   P   R   S   V   W  
Index Entry  Section

*
*board*: Internal special variables
*clock*: Internal special variables
*edge-and-x-lists*: Internal special variables
*edge-table*: Internal special variables
*et-path*: Internal special variables
*move-number*: Internal special variables
*ply-boards*: Internal special variables
*static-edge-table*: Internal special variables
*top-edge*: Internal special variables
*weights*: Internal special variables

+
+all-directions+: Internal special variables
+default-max-minutes+: Internal constants

A
all-squares: Internal special variables

B
bl-strategy: Internal classes
black: Internal constants
board: Internal structures
board: Internal structures
board: Internal classes

C
clock: Internal structures
clock: Internal classes
Constant, +default-max-minutes+: Internal constants
Constant, black: Internal constants
Constant, empty: Internal constants
Constant, losing-value: Internal constants
Constant, outer: Internal constants
Constant, white: Internal constants
Constant, winning-value: Internal constants

E
empty: Internal constants

F
final-result: Internal classes

L
losing-value: Internal constants

M
max-minutes: Internal classes
move: Internal structures
move-number: Internal classes
moves: Internal classes

O
outer: Internal constants

P
player: Internal structures
player: Internal classes
print?: Internal classes

R
record-game?: Internal classes

S
Slot, bl-strategy: Internal classes
Slot, board: Internal structures
Slot, board: Internal structures
Slot, board: Internal classes
Slot, clock: Internal structures
Slot, clock: Internal classes
Slot, final-result: Internal classes
Slot, max-minutes: Internal classes
Slot, move: Internal structures
Slot, move-number: Internal classes
Slot, moves: Internal classes
Slot, player: Internal structures
Slot, player: Internal classes
Slot, print?: Internal classes
Slot, record-game?: Internal classes
Slot, square: Internal structures
Slot, value: Internal structures
Slot, wh-strategy: Internal classes
Special Variable, *board*: Internal special variables
Special Variable, *clock*: Internal special variables
Special Variable, *edge-and-x-lists*: Internal special variables
Special Variable, *edge-table*: Internal special variables
Special Variable, *et-path*: Internal special variables
Special Variable, *move-number*: Internal special variables
Special Variable, *ply-boards*: Internal special variables
Special Variable, *static-edge-table*: Internal special variables
Special Variable, *top-edge*: Internal special variables
Special Variable, *weights*: Internal special variables
Special Variable, +all-directions+: Internal special variables
Special Variable, all-squares: Internal special variables
square: Internal structures

V
value: Internal structures

W
wh-strategy: Internal classes
white: Internal constants
winning-value: Internal constants

Jump to:   *   +  
A   B   C   E   F   L   M   O   P   R   S   V   W  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   B   C   D   E   M   N   P   R   S   T  
Index Entry  Section

B
board: Internal types

C
Class, reversi-game: Internal classes
clock: Internal types

D
dir: Internal types

E
edge-table: Internal types

M
move: Internal types
moves: Internal types

N
node: Internal structures

P
Package, reversi: The reversi package
Package, reversi-system: The reversi-system package
piece: Internal types
player: Internal types

R
reversi: The reversi system
reversi: The reversi package
reversi-game: Internal classes
reversi-system: The reversi-system package

S
square: Internal types
state: Internal structures
Structure, node: Internal structures
Structure, state: Internal structures
System, reversi: The reversi system

T
Type, board: Internal types
Type, clock: Internal types
Type, dir: Internal types
Type, edge-table: Internal types
Type, move: Internal types
Type, moves: Internal types
Type, piece: Internal types
Type, player: Internal types
Type, square: Internal types

Jump to:   B   C   D   E   M   N   P   R   S   T