(*
* LikeEternalAndRealNeurons (L.E.A.R.N)
*
* Copyright (c) 2006 Gilles Bizet
*
* This file is part of LikeEternalAndRealNeurons (L.E.A.R.N)
*
* LikeEternalAndRealNeurons (L.E.A.R.N)
* is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* LikeEternalAndRealNeurons (L.E.A.R.N)
* is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with Foobar; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*)
(**************************************************************************) |
(*open Database*)
open Definitions
let f=f0;;
(*let x=(0,0) and y=(0,4);;*)
(*TOUR/ROOK*)
let r f x y = (fst (f x) = 'r')&& (y--> dNS (fst x) (snd x)) && (segV x y) && (rr f x y);;
r f x y;;
(*FOU/BISHOP*)
let b f x y = ((fst (f x)) = 'b') && (y--> diag (fst x) (snd x)) && (segV x y) && (rr f x y);;
b f x y;;
(*DAME/QUEEN*)
let q f x y = (fst (f x) = 'q')&&(y-->dir (fst x) (snd x))&& (segV x y) && (rr f x y);;
q f x y;;
(*ROI/KING*)
(*voisinage du roi*)
let voisK i j = let p y = (dist (i,j) y =1)in Ensemble.filter p (dir i j);;
Ensemble.elements (dir 0 1);;
Ensemble.elements (voisK 0 1);;