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

Game Description

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Hallway
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  (role white)
  (role black)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  (init (cell a 1 b))
  (init (cell a 2 b))
  (init (cell a 3 b))
  (init (cell a 4 b))
  (init (cell a 5 wp))
  (init (cell a 6 b))
  (init (cell a 7 b))
  (init (cell a 8 b))
  (init (cell a 9 b))
  (init (cell b 1 b))
  (init (cell b 2 b))
  (init (cell b 3 b))
  (init (cell b 4 b))
  (init (cell b 5 b))
  (init (cell b 6 b))
  (init (cell b 7 b))
  (init (cell b 8 b))
  (init (cell b 9 b))
  (init (cell c 1 b))
  (init (cell c 2 b))
  (init (cell c 3 b))
  (init (cell c 4 b))
  (init (cell c 5 b))
  (init (cell c 6 b))
  (init (cell c 7 b))
  (init (cell c 8 b))
  (init (cell c 9 b))
  (init (cell d 1 b))
  (init (cell d 2 b))
  (init (cell d 3 b))
  (init (cell d 4 b))
  (init (cell d 5 b))
  (init (cell d 6 b))
  (init (cell d 7 b))
  (init (cell d 8 b))
  (init (cell d 9 b))
  (init (cell e 1 b))
  (init (cell e 2 b))
  (init (cell e 3 b))
  (init (cell e 4 b))
  (init (cell e 5 b))
  (init (cell e 6 b))
  (init (cell e 7 b))
  (init (cell e 8 b))
  (init (cell e 9 b))
  (init (cell f 1 b))
  (init (cell f 2 b))
  (init (cell f 3 b))
  (init (cell f 4 b))
  (init (cell f 5 b))
  (init (cell f 6 b))
  (init (cell f 7 b))
  (init (cell f 8 b))
  (init (cell f 9 b))
  (init (cell g 1 b))
  (init (cell g 2 b))
  (init (cell g 3 b))
  (init (cell g 4 b))
  (init (cell g 5 b))
  (init (cell g 6 b))
  (init (cell g 7 b))
  (init (cell g 8 b))
  (init (cell g 9 b))
  (init (cell h 1 b))
  (init (cell h 2 b))
  (init (cell h 3 b))
  (init (cell h 4 b))
  (init (cell h 5 b))
  (init (cell h 6 b))
  (init (cell h 7 b))
  (init (cell h 8 b))
  (init (cell h 9 b))
  (init (cell i 1 b))
  (init (cell i 2 b))
  (init (cell i 3 b))
  (init (cell i 4 b))
  (init (cell i 5 bp))
  (init (cell i 6 b))
  (init (cell i 7 b))
  (init (cell i 8 b))
  (init (cell i 9 b))
;; Wall separating (row/column) arg1 from arg2 across (columns/rows) arg3 and arg4

  (init (wall a b 1 2 none))
  (init (wall a b 2 3 none))
  (init (wall a b 3 4 none))
  (init (wall a b 4 5 none))
  (init (wall a b 5 6 none))
  (init (wall a b 6 7 none))
  (init (wall a b 7 8 none))
  (init (wall a b 8 9 none))
  (init (wall b c 1 2 none))
  (init (wall b c 2 3 none))
  (init (wall b c 3 4 none))
  (init (wall b c 4 5 none))
  (init (wall b c 5 6 none))
  (init (wall b c 6 7 none))
  (init (wall b c 7 8 none))
  (init (wall b c 8 9 none))
  (init (wall c d 1 2 none))
  (init (wall c d 2 3 none))
  (init (wall c d 3 4 none))
  (init (wall c d 4 5 none))
  (init (wall c d 5 6 none))
  (init (wall c d 6 7 none))
  (init (wall c d 7 8 none))
  (init (wall c d 8 9 none))
  (init (wall d e 1 2 none))
  (init (wall d e 2 3 none))
  (init (wall d e 3 4 none))
  (init (wall d e 4 5 none))
  (init (wall d e 5 6 none))
  (init (wall d e 6 7 none))
  (init (wall d e 7 8 none))
  (init (wall d e 8 9 none))
  (init (wall e f 1 2 none))
  (init (wall e f 2 3 none))
  (init (wall e f 3 4 none))
  (init (wall e f 4 5 none))
  (init (wall e f 5 6 none))
  (init (wall e f 6 7 none))
  (init (wall e f 7 8 none))
  (init (wall e f 8 9 none))
  (init (wall f g 1 2 none))
  (init (wall f g 2 3 none))
  (init (wall f g 3 4 none))
  (init (wall f g 4 5 none))
  (init (wall f g 5 6 none))
  (init (wall f g 6 7 none))
  (init (wall f g 7 8 none))
  (init (wall f g 8 9 none))
  (init (wall g h 1 2 none))
  (init (wall g h 2 3 none))
  (init (wall g h 3 4 none))
  (init (wall g h 4 5 none))
  (init (wall g h 5 6 none))
  (init (wall g h 6 7 none))
  (init (wall g h 7 8 none))
  (init (wall g h 8 9 none))
  (init (wall h i 1 2 none))
  (init (wall h i 2 3 none))
  (init (wall h i 3 4 none))
  (init (wall h i 4 5 none))
  (init (wall h i 5 6 none))
  (init (wall h i 6 7 none))
  (init (wall h i 7 8 none))
  (init (wall h i 8 9 none))

  (init (walls white 4))
  (init (walls black 4))

  (init (control white))
  (init (step 1))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  (<= (next (cell ?x ?y ?q))
      (true (cell ?x ?y ?q))
      (does ?player (place ?x1 ?x2 ?y1 ?y2)))

  (<= (next (cell ?x ?y ?q))
      (true (cell ?x ?y ?q))
      (true (control ?player))
      (does ?player noop))

  (<= (next (cell ?x ?y ?p))
      (does ?player (move ?p ?u ?v ?x ?y)))

  (<= (next (cell ?u ?v b))
      (does ?player (move ?p ?u ?v ?x ?y)))

  (<= (next (cell ?w ?z b))
      (does ?player (move ?p ?u ?v ?x ?y))
      (true (cell ?w ?z b))
      (or (distinct ?w ?x) (distinct ?z ?y)))

  (<= (next (cell ?w ?z ?q))
      (does ?player (move ?p ?u ?v ?x ?y))
      (true (cell ?w ?z ?q))
      (distinct ?p ?q)
      (distinct ?q b))

  (<= (next (wall ?x1 ?x2 ?y1 ?y2 ?value))
      (true (wall ?x1 ?x2 ?y1 ?y2 ?value))
      (true (control ?player))
      (does ?player noop))
  
  (<= (next (wall ?x1 ?x2 ?y1 ?y2 ?z))
      (does ?player (move ?p ?u ?v ?x ?y))
      (true (wall ?x1 ?x2 ?y1 ?y2 ?z)))

  (<= (next (wall ?x1 ?x2 ?y1 ?y2 ?wall))
      (does ?player (place ?u ?v ?x ?y))
      (true (wall ?x1 ?x2 ?y1 ?y2 ?wall))
      (distinct ?wall none))

  (<= (next (wall ?x1 ?x2 ?y1 ?y2 none))
      (does ?player (place ?u ?v ?x ?y))
      (true (wall ?x1 ?x2 ?y1 ?y2 none))
      (or (distinct ?x1 ?u) (distinct ?x2 ?v) (distinct ?y1 ?x) (distinct ?y2 ?y)))

  (<= (next (wall ?x1 ?x2 ?y1 ?y2 ?player))
      (does ?player (place ?x1 ?x2 ?y1 ?y2))
      (true (wall ?x1 ?x2 ?y1 ?y2 none)))

  (<= (next (control white))
      (true (control black)))

  (<= (next (control black))
      (true (control white)))

  (<= (next (walls ?player ?num))
      (does ?p1 (move ?p ?x ?y ?u ?v))
      (true (walls ?player ?num)))

  (<= (next (walls ?player ?num))
      (does ?p1 (place ?x1 ?x2 ?y1 ?y2))
      (true (walls ?player ?num))
      (distinct ?player ?p1))

  (<= (next (walls ?player ?n))
      (does ?player (place ?x1 ?x2 ?y1 ?y2))
      (true (walls ?player ?m))
      (succ ?n ?m))

  (<= (next (step ?y))
      (true (step ?x))
      (succ ?x ?y))

  (succ 0 1)
  (succ 1 2)
  (succ 2 3)
  (succ 3 4)
  (succ 4 5)
  (succ 5 6)
  (succ 6 7)
  (succ 7 8)
  (succ 8 9)
  (succ 9 10)
  (succ 10 11)
  (succ 11 12)
  (succ 12 13)
  (succ 13 14)
  (succ 14 15)
  (succ 15 16)
  (succ 16 17)
  (succ 17 18)
  (succ 18 19)
  (succ 19 20)
  (succ 20 21)
  (succ 21 22)
  (succ 22 23)
  (succ 23 24)
  (succ 24 25)
  (succ 25 26)
  (succ 26 27)
  (succ 27 28)
  (succ 28 29)
  (succ 29 30)
  (succ 30 31)

  (<= (greater ?a ?b)
      (succ ?b ?a))
  (<= (greater ?a ?b)
      (distinct ?a ?b)
      (succ ?c ?a)
      (greater ?c ?b))

(coordinate 1)
(coordinate 2)
(coordinate 3)
(coordinate 4)
(coordinate 5)
(coordinate 6)
(coordinate 7)
(coordinate 8)
(coordinate 9)
(coordinate a)
(coordinate b)
(coordinate c)
(coordinate d)
(coordinate e)
(coordinate f)
(coordinate g)
(coordinate h)
(coordinate i)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  (<= (legal ?player (place ?c1 ?c2 1 2))
      (true (control ?player))
      (true (walls ?player ?n))
      (greater ?n 0)
      (true (wall ?c1 ?c2 1 2 none))
      (true (wall ?c1 ?c2 2 3 none)))

  (<= (legal ?player (place ?c1 ?c2 8 9))
      (true (control ?player))
      (true (walls ?player ?n))
      (greater ?n 0)
      (true (wall ?c1 ?c2 8 9 none))
      (true (wall ?c1 ?c2 7 8 none)))

  (<= (legal ?player (place ?c1 ?c2 ?r1 ?r2))
      (true (control ?player))
      (true (walls ?player ?n))
      (greater ?n 0)
      (true (wall ?c1 ?c2 ?r1 ?r2 none))
      (adjacent ?r2 ?r3)
      (true (wall ?c1 ?c2 ?r2 ?r3 none))
      (adjacent ?r0 ?r1)
      (true (wall ?c1 ?c2 ?r2 ?r3 none)))

  (<= (legal white (move wp ?u ?v ?x ?y))
      (true (control white))
      (true (cell ?u ?v wp))
      (pawnmove ?u ?v ?x ?y)
      (true (cell ?x ?y b)))

  (<= (legal black (move bp ?u ?v ?x ?y))
      (true (control black))
      (true (cell ?u ?v bp))
      (pawnmove ?u ?v ?x ?y)
      (true (cell ?x ?y b)))

  (<= (legal ?player noop)
      (role ?player))

  (<= (pawnmove ?c ?r1 ?c ?r2)
      (adjacent ?r1 ?r2)
      (coordinate ?c))

  (<= (pawnmove ?c ?r1 ?c ?r2)
      (adjacent ?r2 ?r1)
      (coordinate ?c))

  (<= (pawnmove ?c1 1 ?c2 1)
      (nextcolumn ?c1 ?c2) 
      (true (wall ?c1 ?c2 1 2 none)))

  (<= (pawnmove ?c1 1 ?c2 1)
      (nextcolumn ?c2 ?c1)
      (true (wall ?c2 ?c1 1 2 none)))

  (<= (pawnmove ?c1 9 ?c2 9)
      (nextcolumn ?c1 ?c2)
      (true (wall ?c1 ?c2 8 9 none)))

  (<= (pawnmove ?c1 9 ?c2 9)
      (nextcolumn ?c2 ?c1)
      (true (wall ?c2 ?c1 8 9 none)))
            
  (<= (pawnmove ?c1 ?r ?c2 ?r)
      (nextcolumn ?c1 ?c2)
      (adjacent ?r ?rn)
      (adjacent ?rp ?r)
      (true (wall ?c1 ?c2 ?r ?rn none))
      (true (wall ?c1 ?c2 ?rp ?r none)))

   (<= (pawnmove ?c1 ?r ?c2 ?r)
       (nextcolumn ?c2 ?c1)
       (adjacent ?r ?rn)
       (adjacent ?rp ?r)      
       (true (wall ?c2 ?c1 ?r ?rn none))
       (true (wall ?c2 ?c1 ?rp ?r none)))

  (adjacent 1 2)
  (adjacent 2 3)
  (adjacent 3 4)
  (adjacent 4 5)
  (adjacent 5 6)
  (adjacent 6 7)
  (adjacent 7 8)
  (adjacent 8 9)

  (nextcolumn a b)
  (nextcolumn b c)
  (nextcolumn c d)
  (nextcolumn d e)
  (nextcolumn e f)
  (nextcolumn f g)
  (nextcolumn g h)
  (nextcolumn h i)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  (<= (goal white 100)
      (true (cell i ?x wp)))

  (<= (goal white 0)
      (true (cell a ?x bp)))

  (<= (goal black 100)
      (true (cell a ?x bp)))

  (<= (goal black 0)
      (true (cell i ?x wp)))

  (<= (goal ?role 50)
      (true (step 31))
      (true (cell ?c1 ?r1 bp))
      (true (cell ?c2 ?r2 wp))
      (distinct ?c1 a)
      (distinct ?c2 i)
      (role ?role))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  (<= terminal
      (true (step 31)))

  (<= terminal
      (goal ?role 100))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

sees_XML(...) rules

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