You are not logged in. login register
Game knightstour
name knightstour
creator admin
number of roles 1
stylesheet knightstour/knightstour.xsl
GDL v1
enabled
matches show matches
statistics show game statistics
description

Game Description

(role robot)
(init (movecount 0))
(init (cell 1 1 knight))
(<= (next (movecount ?newcount))
    (true (movecount ?oldcount))
    (plus 1 count ?oldcount ?newcount))
(<= (next (cell ?x ?y hole))
    (true (cell ?x ?y hole)))
(<= (next (cell ?x1 ?y1 hole))
    (does robot (move ?x1 ?y1 ?x2 ?y2)))
(<= (next (cell ?x2 ?y2 knight))
    (does robot (move ?x1 ?y1 ?x2 ?y2)))
(<= (legal robot (move ?x1 ?y1 ?x2 ?y2))
    (true (cell ?x1 ?y1 knight))
    (knightmove ?x1 ?y1 ?x2 ?y2))
(<= (goal robot ?goal)
    (true (movecount ?count))
    (scoremap ?count ?goal))
(<= terminal
    (true (cell ?x ?y knight))
    (true (cell ?x ?y hole)))
(<= (knightmove ?x1 ?y1 ?x2 ?y2)
    (plus 1 x ?x1 ?x2)
    (plus 2 y ?y1 ?y2))
(<= (knightmove ?x1 ?y1 ?x2 ?y2)
    (plus 1 x ?x1 ?x2)
    (plus 2 y ?y2 ?y1))
(<= (knightmove ?x1 ?y1 ?x2 ?y2)
    (plus 1 x ?x2 ?x1)
    (plus 2 y ?y1 ?y2))
(<= (knightmove ?x1 ?y1 ?x2 ?y2)
    (plus 1 x ?x2 ?x1)
    (plus 2 y ?y2 ?y1))
(<= (knightmove ?x1 ?y1 ?x2 ?y2)
    (plus 2 x ?x1 ?x2)
    (plus 1 y ?y1 ?y2))
(<= (knightmove ?x1 ?y1 ?x2 ?y2)
    (plus 2 x ?x1 ?x2)
    (plus 1 y ?y2 ?y1))
(<= (knightmove ?x1 ?y1 ?x2 ?y2)
    (plus 2 x ?x2 ?x1)
    (plus 1 y ?y1 ?y2))
(<= (knightmove ?x1 ?y1 ?x2 ?y2)
    (plus 2 x ?x2 ?x1)
    (plus 1 y ?y2 ?y1))
(plus 1 count 0 1)
(plus 1 count 1 2)
(plus 1 count 2 3)
(plus 1 count 3 4)
(plus 1 count 4 5)
(plus 1 count 5 6)
(plus 1 count 6 7)
(plus 1 count 7 8)
(plus 1 count 8 9)
(plus 1 count 9 10)
(plus 1 count 10 11)
(plus 1 count 11 12)
(plus 1 count 12 13)
(plus 1 count 13 14)
(plus 1 count 14 15)
(plus 1 count 15 16)
(plus 1 count 16 17)
(plus 1 count 17 18)
(plus 1 count 18 19)
(plus 1 count 19 20)
(plus 1 count 20 21)
(plus 1 count 21 22)
(plus 1 count 22 23)
(plus 1 count 23 24)
(plus 1 count 24 25)
(plus 1 count 25 26)
(plus 1 count 26 27)
(plus 1 count 27 28)
(plus 1 count 28 29)
(plus 1 count 29 30)
(plus 1 x 1 2)
(plus 1 x 2 3)
(plus 1 x 3 4)
(plus 1 x 4 5)
(plus 1 x 5 6)
(plus 1 y 1 2)
(plus 1 y 2 3)
(plus 1 y 3 4)
(plus 1 y 4 5)
(plus 2 x 1 3)
(plus 2 x 2 4)
(plus 2 x 3 5)
(plus 2 x 4 6)
(plus 2 y 1 3)
(plus 2 y 2 4)
(plus 2 y 3 5)
(scoremap 0 0)
(scoremap 1 3)
(scoremap 2 6)
(scoremap 3 9)
(scoremap 4 12)
(scoremap 5 15)
(scoremap 6 18)
(scoremap 7 21)
(scoremap 8 24)
(scoremap 9 27)
(scoremap 10 30)
(scoremap 11 33)
(scoremap 12 36)
(scoremap 13 39)
(scoremap 14 42)
(scoremap 15 45)
(scoremap 16 48)
(scoremap 17 51)
(scoremap 18 54)
(scoremap 19 57)
(scoremap 20 60)
(scoremap 21 63)
(scoremap 22 66)
(scoremap 23 69)
(scoremap 24 72)
(scoremap 25 75)
(scoremap 26 80)
(scoremap 27 85)
(scoremap 28 90)
(scoremap 29 96)
(scoremap 30 100)

sees_XML(...) rules

(<= (sees_xml random ?t) (true ?t))
(<= (sees_xml ?p ?t) (role ?p) (distinct ?p random) (true ?t))