Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Comments.

  • Loading branch information...
commit e6176c7a479cdc070e0e7cf9d80fa2469f0176a8 1 parent dcf862a
Mikhail Glushenkov authored
Showing with 6 additions and 5 deletions.
  1. +3 −2 alphabeta.ml
  2. +1 −1  alphabeta.mli
  3. +1 −1  game_state.mli
  4. +1 −1  util.mli
5 alphabeta.ml
View
@@ -30,7 +30,8 @@ struct
let successors = T.successor color state in
if null successors
then
- (* NB: Instead of a termination test, we use. *)
+ (* NB: Instead of a termination test, we check if any of the players
+ has any valid moves (see the rules of Othello). *)
if T.any_valid_moves state opp
then map_snd (~-) (go state opp (depth-1) (-beta) (-alpha))
else
@@ -59,5 +60,5 @@ struct
let (move, _) = go state max_player depth minus_inf plus_inf in
match move with
| Some m -> m
- | None -> failwith "alphabeta: returned an empty move!"
+ | None -> failwith "alphabeta: no move possible!"
end
2  alphabeta.mli
View
@@ -34,7 +34,7 @@ module type GameStateSig = sig
end
-(** Given a game state module, produce a . *)
+(** Given a game state module, produce a custom alpha-beta search function. *)
module Make : functor (T : GameStateSig) ->
sig
val alphabeta : ?depth:int -> T.t -> T.player_color -> T.pos
2  game_state.mli
View
@@ -28,7 +28,7 @@ val create : unit -> t
(** Print out the game state. *)
val show : t -> unit
-(** Run a side-effecting function on each cell *)
+(** Run a side-effecting function on each cell. *)
val iteri : t -> (int -> int -> [`White | `Black | `Empty] -> unit) -> unit
(** What is the current score? *)
2  util.mli
View
@@ -33,5 +33,5 @@ val map_fst : ('a -> 'b) -> ('a * 'c) -> ('b * 'c)
(** Apply the function to the second element of a tuple. *)
val map_snd : ('a -> 'b) -> ('c * 'a) -> ('c * 'b)
-(** Deep-copy of a 2-dimensional! array. *)
+(** Deep-copy a 2-dimensional array. *)
val copy_matrix : 'a array array -> 'a array array
Please sign in to comment.
Something went wrong with that request. Please try again.