package knights_tour

  1. Overview
  2. Docs
Solves the Knight's tour puzzle; and others

Install

dune-project
 Dependency

Authors

Maintainers

Sources

knights_tour-0.0.3.tbz
sha256=4c693ffd5554cdbb064b0aa2ec104ec1831d3abd077ea2cec0a52922ebdc2212
sha512=f3cd71b81c7e44e7186e43c407ee679a2fede799a8aa07c495932a1a7469c5cc80a32f28eaa0b2868d195e64896802baf7959bae5b3466f777279fa1500f3e60

doc/src/knights_tour/point.ml.html

Source file point.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
type t = {x: int; y:int}

let compare {x=x1;y=y1} {x=x2;y=y2} =
  let xcomp = y1 - y2 in
  if xcomp<>0 then 
    xcomp
  else
    x1 - x2

let diff p1 p2 = {
  x = p1.x - p2.x; 
  y = p1.y - p2.y;
}

module Set =
    Set.Make(struct type nonrec t = t let compare = compare end)
OCaml

Innovation. Community. Security.