GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  GAMES::ALPHABETA::POSITION (3)

.ds Aq ’

NAME

Games::AlphaBeta::Position - base Position class for use with Games::AlphaBeta

CONTENTS

SYNOPSIS



    package My::GamePos;
    use base qw(Games::AlphaBeta::Position);

    sub apply { ... }
    sub endpos { ... }      # optional
    sub evaluate { ... }
    sub findmoves { ... }

    package main;
    my $pos = My::GamePos->new;
    my $game = Games::AlphaBeta->new($pos);



DESCRIPTION

Games::AlphaBeta::Position is a base class for position-classes that can be used with Games::AlphaBeta. It inherits most of its methods from Games::Sequential::Position; make sure you read its documentation.

This class is provided for convenience. You don’t need this class in order to use Games::AlphaBeta. It is, however, also possible to make use of this class on its own.

INHERITED METHODS

The following methods are inherited from Games::Sequential::Position:
new
init
copy
player

VIRTUAL METHODS

Modules inheriting this class must implement the following methods (in addition to apply() and anything else required by Games::Sequential::Position): evaluate() & findmoves().
findmoves() Return an array of all moves possible for the current player at the current position. Don’t forget to return a null move if the player is allowed to pass; an empty array returned here denotes an ending position in the game.
evaluate() Return the fitness value for the current player at the current position.

METHODS

The following methods are provided by this class.
endpos True if the position is an ending position, i.e. either a draw or a win for one of the players.

Note: Not all games need this method, so the default implementation provided by this modules always returns false.

SEE ALSO

The author’s website, describing this and other projects: <http://brautaset.org/projects/>

AUTHOR

Stig Brautaset, <stig@brautaset.org>

COPYRIGHT AND LICENCE

Copyright (C) 2004 by Stig Brautaset

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.3 or, at your option, any later version of Perl 5 you may have available.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 GAMES::ALPHABETA::POSITION (3) 2016-03-17

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.