aboutsummaryrefslogtreecommitdiff
path: root/judge/morpion_rec.ml
diff options
context:
space:
mode:
authorAlex AUVOLAT <alex.auvolat@ens.fr>2014-11-10 14:08:04 +0100
committerAlex AUVOLAT <alex.auvolat@ens.fr>2014-11-10 14:08:04 +0100
commit12622a51b1591d3ecab970612ade4d912469b456 (patch)
tree4efbda4229d600ca12972c5448fdaeda4e4e6de3 /judge/morpion_rec.ml
parentf881660a9d1b37ede991495707bf9fd5ebdcea81 (diff)
downloadCompetIA-12622a51b1591d3ecab970612ade4d912469b456.tar.gz
CompetIA-12622a51b1591d3ecab970612ade4d912469b456.zip
Implement TIME OUT.
Diffstat (limited to 'judge/morpion_rec.ml')
-rw-r--r--judge/morpion_rec.ml10
1 files changed, 5 insertions, 5 deletions
diff --git a/judge/morpion_rec.ml b/judge/morpion_rec.ml
index 0741742..c7ca480 100644
--- a/judge/morpion_rec.ml
+++ b/judge/morpion_rec.ml
@@ -1,7 +1,6 @@
open Core
open Main
-let ( |> ) x f = f x
module G = struct
@@ -76,21 +75,22 @@ module G = struct
| l when List.exists ((=) Empty) l -> Empty
| _ -> T
-
(* setp0 : ('a, 'a, 'a) -> int -> 'a -> ('a, 'a, 'a) *)
let setp0 (a, b, c) x v = match x with
| 1 -> (v, b, c)
| 2 -> (a, v, c)
| 3 -> (a, b, v)
| _ -> raise Invalid_pos
+
(* setp1 : 'a morpion -> loc1 -> 'a -> ('a -> 'c) -> 'a morpion *)
let setp1 (m, r) (px, py) v rf =
let k = setp0 m px (setp0 (getp0 m px) py v) in
(k, if r = Empty then reduce_m rf (k, r) else r)
(* pourquoi ce if ? parce que si quelqu'un a déjà gagné un petit morpion,
- alors même si l'adversaire aligne trois pions, le petit morpion lui
- reste attribué... *)
- (* setp2 : 'a morpion morpion -> loc2 -> 'a -> 'a morpion morpion *)
+ alors même si l'adversaire aligne trois cases dedans APRES,
+ le petit morpion reste attribué à la même personne. *)
+
+ (* setp : 'a morpion morpion -> loc2 -> 'a -> 'a morpion morpion *)
let setp m (pg, pp) v =
let im = setp1 (getp1 m pg) pp v (fun x -> x) in
let om = setp1 m pg im reduct in