28 May 2007

  • Tried to define an interface to bkeSomeren.pl. Maarten uses Bratko's minimax, but with heuristic values for terminal positions at a fixed depth.
  • Interface is quite simple:


    my_staticval( Bord, +1) :-
    winnaar(Bord, o).

    my_staticval( Bord, -1) :-
    winnaar(Bord, x).

    my_staticval( Bord, 0) :-
    winnaar(Bord, draw).

    my_max_to_move( Bord ) :-
    beurt(x).

    my_min_to_move( Bord ) :-
    beurt(o).

  • Result is less simple:


    ?- consult(bkeSomeren).
    ?- consult(minimaxSomeren).
    Warning: (/home/arnoud/onderwijs/ZSB/assistance/2007/minimaxSomeren.pl:22):
    Singleton variables: [Pos1]
    Warning: (/home/arnoud/onderwijs/ZSB/assistance/2007/minimaxSomeren.pl:29):
    Singleton variables: [Pos0, Val0]
    Warning: (/home/arnoud/onderwijs/ZSB/assistance/2007/minimaxSomeren.pl:42):
    Singleton variables: [Bord]
    Warning: (/home/arnoud/onderwijs/ZSB/assistance/2007/minimaxSomeren.pl:45):
    Singleton variables: [Bord]
    % minimaxSomeren compiled 0.00 sec, 256 bytes

    Yes
    ?- initial(State).

    State = state([e, e, e, e, e, e, e, e|...], o)

    Yes
    ?- minimax(State, BestSucc, Val).
    ERROR: Out of local stack
    ?-