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

Game Description

(role white)
(role black)
(init (cell 1 1 white))
(init (cell 10 10 black))
(init (movecontrol white))
(<= (legal ?role (move ?x1 ?y1 ?x2 ?y2))
    (true (movecontrol ?role))
    (true (cell ?x1 ?y1 ?role))
    (knightmove ?x1 ?y1 ?x2 ?y2)
    (opponent ?role ?opponent)
    (not (true (cell ?x2 ?y2 ?opponent))))
(<= (legal ?role ortho)
    (true (attackcontrol ?role)))
(<= (legal ?role diag)
    (true (attackcontrol ?role)))
(<= (legal ?role noop)
    (true (attackcontrol ?opponent))
    (opponent ?opponent ?role))
(<= (legal ?role noop)
    (true (movecontrol ?opponent))
    (opponent ?opponent ?role))
(<= (next (attackcontrol ?opponent))
    (true (movecontrol ?role))
    (opponent ?role ?opponent))
(<= (next (movecontrol ?role))
    (true (attackcontrol ?role)))
(<= (next (cell ?x ?y ?state))
    (true (cell ?x ?y ?state))
    (does ?role ortho))
(<= (next (cell ?x2 ?y2 arrow))
    (does ?role ortho)
    (opponent ?role ?opponent)
    (true (cell ?x1 ?y1 ?opponent))
    (orthogonal ?x1 ?y1 ?x2 ?y2))
(<= (next (cell ?x ?y ?state))
    (true (cell ?x ?y ?state))
    (does ?role diag))
(<= (next (cell ?x2 ?y2 arrow))
    (does ?role diag)
    (opponent ?role ?opponent)
    (true (cell ?x1 ?y1 ?opponent))
    (diagonal ?x1 ?y1 ?x2 ?y2))
(<= (next (cell ?x ?y ?state))
    (true (cell ?x ?y ?state))
    (does ?role (move ?x1 ?y1 ?x2 ?y2))
    (distinctcell ?x ?y ?x1 ?y1))
(<= (next (cell ?x1 ?y1 arrow))
    (does ?role (move ?x1 ?y1 ?x2 ?y2)))
(<= (next (cell ?x2 ?y2 ?role))
    (does ?role (move ?x1 ?y1 ?x2 ?y2)))
(<= terminal
    whitewin)
(<= terminal
    blackwin)
(<= (goal white 100)
    whitewin)
(<= (goal white 0)
    blackwin)
(<= (goal black 100)
    blackwin)
(<= (goal black 0)
    whitewin)
(<= whitewin
    (true (cell ?x ?y black))
    (true (cell ?x ?y arrow)))
(<= blackwin
    (true (cell ?x ?y white))
    (true (cell ?x ?y arrow)))
(<= (knightmove ?x1 ?y1 ?x2 ?y2)
    (plus 1 ?x1 ?x2)
    (plus 2 ?y1 ?y2))
(<= (knightmove ?x1 ?y1 ?x2 ?y2)
    (plus 1 ?x1 ?x2)
    (plus 2 ?y2 ?y1))
(<= (knightmove ?x1 ?y1 ?x2 ?y2)
    (plus 1 ?x2 ?x1)
    (plus 2 ?y1 ?y2))
(<= (knightmove ?x1 ?y1 ?x2 ?y2)
    (plus 1 ?x2 ?x1)
    (plus 2 ?y2 ?y1))
(<= (knightmove ?x1 ?y1 ?x2 ?y2)
    (plus 2 ?x1 ?x2)
    (plus 1 ?y1 ?y2))
(<= (knightmove ?x1 ?y1 ?x2 ?y2)
    (plus 2 ?x1 ?x2)
    (plus 1 ?y2 ?y1))
(<= (knightmove ?x1 ?y1 ?x2 ?y2)
    (plus 2 ?x2 ?x1)
    (plus 1 ?y1 ?y2))
(<= (knightmove ?x1 ?y1 ?x2 ?y2)
    (plus 2 ?x2 ?x1)
    (plus 1 ?y2 ?y1))
(<= (orthogonal ?x ?y1 ?x ?y2)
    (index ?x)
    (plus 1 ?y1 ?y2))
(<= (orthogonal ?x ?y1 ?x ?y2)
    (index ?x)
    (plus 1 ?y2 ?y1))
(<= (orthogonal ?x1 ?y ?x2 ?y)
    (plus 1 ?x1 ?x2)
    (index ?y))
(<= (orthogonal ?x1 ?y ?x2 ?y)
    (plus 1 ?x2 ?x1)
    (index ?y))
(<= (diagonal ?x1 ?y1 ?x2 ?y2)
    (plus 1 ?x1 ?x2)
    (plus 1 ?y1 ?y2))
(<= (diagonal ?x1 ?y1 ?x2 ?y2)
    (plus 1 ?x1 ?x2)
    (plus 1 ?y2 ?y1))
(<= (diagonal ?x1 ?y1 ?x2 ?y2)
    (plus 1 ?x2 ?x1)
    (plus 1 ?y1 ?y2))
(<= (diagonal ?x1 ?y1 ?x2 ?y2)
    (plus 1 ?x2 ?x1)
    (plus 1 ?y2 ?y1))
(<= (onboard ?x ?y)
    (index ?x)
    (index ?y))
(<= (distinctcell ?x1 ?y1 ?x2 ?y2)
    (onboard ?x1 ?y1)
    (onboard ?x2 ?y2)
    (distinct ?x1 ?x2))
(<= (distinctcell ?x1 ?y1 ?x2 ?y2)
    (onboard ?x1 ?y1)
    (onboard ?x2 ?y2)
    (distinct ?y1 ?y2))
(opponent white black)
(opponent black white)
(index 1)
(index 2)
(index 3)
(index 4)
(index 5)
(index 6)
(index 7)
(index 8)
(index 9)
(index 10)
(plus 1 1 2)
(plus 1 2 3)
(plus 1 3 4)
(plus 1 4 5)
(plus 1 5 6)
(plus 1 6 7)
(plus 1 7 8)
(plus 1 8 9)
(plus 1 9 10)
(plus 2 1 3)
(plus 2 2 4)
(plus 2 3 5)
(plus 2 4 6)
(plus 2 5 7)
(plus 2 6 8)
(plus 2 7 9)
(plus 2 8 10)

sees_XML(...) rules

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