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

Game Description

(role white)
(role black)

(init (cell 1 1 w))
(init (cell 2 1 w))
(init (cell 3 1 w))
(init (cell 4 1 w))
(init (cell 5 1 w))
(init (cell 6 1 w))
(init (cell 7 1 w))
(init (cell 8 1 w))
(init (cell 9 1 w))
(init (cell 10 1 w))
(init (cell 11 1 w))
(init (cell 12 1 w))
(init (cell 13 1 w))
(init (cell 1 2 w))
(init (cell 2 2 w))
(init (cell 3 2 w))
(init (cell 4 2 o))
(init (cell 5 2 o))
(init (cell 6 2 o))
(init (cell 7 2 o))
(init (cell 8 2 o))
(init (cell 9 2 o))
(init (cell 10 2 o))
(init (cell 11 2 w))
(init (cell 12 2 w))
(init (cell 13 2 w))
(init (cell 1 3 w))
(init (cell 2 3 w))
(init (cell 3 3 w))
(init (cell 4 3 o))
(init (cell 5 3 w))
(init (cell 6 3 w))
(init (cell 7 3 w))
(init (cell 8 3 w))
(init (cell 9 3 w))
(init (cell 10 3 o))
(init (cell 11 3 w))
(init (cell 12 3 w))
(init (cell 13 3 w))
(init (cell 1 4 w))
(init (cell 2 4 w))
(init (cell 3 4 w))
(init (cell 4 4 o))
(init (cell 5 4 w))
(init (cell 6 4 w))
(init (cell 7 4 o))
(init (cell 8 4 w))
(init (cell 9 4 w))
(init (cell 10 4 o))
(init (cell 11 4 w))
(init (cell 12 4 w))
(init (cell 13 4 w))
(init (cell 1 5 w))
(init (cell 2 5 a))  ; a
(init (cell 3 5 o))
(init (cell 4 5 o))
(init (cell 5 5 o))
(init (cell 6 5 o))
(init (cell 7 5 o))
(init (cell 8 5 o))
(init (cell 9 5 o))
(init (cell 10 5 o))
(init (cell 11 5 o))
(init (cell 12 5 b)) ; b
(init (cell 13 5 w))
(init (cell 1 6 w))
(init (cell 2 6 w))
(init (cell 3 6 w))
(init (cell 4 6 o))
(init (cell 5 6 w))
(init (cell 6 6 w))
(init (cell 7 6 o))
(init (cell 8 6 w))
(init (cell 9 6 w))
(init (cell 10 6 o))
(init (cell 11 6 w))
(init (cell 12 6 w))
(init (cell 13 6 w))
(init (cell 1 7 w))
(init (cell 2 7 w))
(init (cell 3 7 w))
(init (cell 4 7 o))
(init (cell 5 7 w))
(init (cell 6 7 w))
(init (cell 7 7 w))
(init (cell 8 7 w))
(init (cell 9 7 w))
(init (cell 10 7 o))
(init (cell 11 7 w))
(init (cell 12 7 w))
(init (cell 13 7 w))
(init (cell 1 8 w))
(init (cell 2 8 w))
(init (cell 3 8 w))
(init (cell 4 8 o))
(init (cell 5 8 o))
(init (cell 6 8 o))
(init (cell 7 8 o))
(init (cell 8 8 o))
(init (cell 9 8 o))
(init (cell 10 8 o))
(init (cell 11 8 w))
(init (cell 12 8 w))
(init (cell 13 8 w))
(init (cell 1 9 w))
(init (cell 2 9 w))
(init (cell 3 9 w))
(init (cell 4 9 w))
(init (cell 5 9 w))
(init (cell 6 9 w))
(init (cell 7 9 w))
(init (cell 8 9 w))
(init (cell 9 9 w))
(init (cell 10 9 w))
(init (cell 11 9 w))
(init (cell 12 9 w))
(init (cell 13 9 w))

(init (step 1))

(init (whitedone 30))
(init (blackdone 30))

;; always legal to noop
(legal white noop)
(legal black noop)

;; legal moves
(<= (legal white (move ?x1 ?y ?x2 ?y))
	(true (cell ?x1 ?y a))
	(true (cell ?x2 ?y o))
	(not (true (cell 12 5 a)))
	(or (succ ?x1 ?x2)
	    (succ ?x2 ?x1)))
(<= (legal white (move ?x ?y1 ?x ?y2))
	(true (cell ?x ?y1 a))
	(true (cell ?x ?y2 o))
	(not (true (cell 12 5 a)))
	(or (succ ?y1 ?y2)
	    (succ ?y2 ?y1)))
(<= (legal black (move ?x1 ?y ?x2 ?y))
	(true (cell ?x1 ?y b))
	(true (cell ?x2 ?y o))
	(not (true (cell 2 5 b)))
	(or (succ ?x1 ?x2)
	    (succ ?x2 ?x1)))
(<= (legal black (move ?x ?y1 ?x ?y2))
	(true (cell ?x ?y1 b))
	(true (cell ?x ?y2 o))
	(not (true (cell 2 5 b)))
	(or (succ ?y1 ?y2)
	    (succ ?y2 ?y1)))


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


;; successor functions
(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)

(coordinate 1)
(coordinate 2)
(coordinate 3)
(coordinate 4)
(coordinate 5)
(coordinate 6)
(coordinate 7)
(coordinate 8)
(coordinate 9)
(coordinate 10)
(coordinate 11)
(coordinate 12)
(coordinate 13)

(<= (greaterthan ?x ?y)
    (succ ?y ?x))
(<= (greaterthan ?x ?y)
    (succ ?z ?x)
    (greaterthan ?z ?y))

;; cell the player moves from is blank, if no collision
(<= (next (cell ?x1 ?y1 o))
	(does ?p (move ?x1 ?y1 ?x2 ?y2))
	(not (collision)))
	
;; what cells are blank
(<= (next (cell ?x ?y o))
    (true (cell ?x ?y o))
    (not (moved_to ?x ?y)))

(<= (moved_to ?x ?y)
    (does ?p (move ?x1 ?y1 ?x ?y)))

;; white's new position
(<= (next (cell ?x ?y a))
	(does white (move ?x1 ?y1 ?x ?y))
	(not (collision)))
(<= (next (cell ?x ?y a))
	(true (cell ?x ?y a))
	(does white noop))
	
;; black's new position
(<= (next (cell ?x ?y b))
	(does black (move ?x1 ?y1 ?x ?y))
	(not (collision)))
(<= (next (cell ?x ?y b))
	(true (cell ?x ?y b))
	(does black noop))


;; everything stays the same if there's a collision
(<= (next (cell ?z ?w ?c))
	(collision)
    (true (cell ?z ?w ?c)))


;; walls stay walls
(<= (next (cell ?x ?y w))
    (true (cell ?x ?y w)))


;; defn of collision
(<= (collision)
	(does white (move ?x1 ?y1 ?x ?y))
	(does black (move ?x2 ?y2 ?x ?y)))
	

(<= (next (whitedone ?x)) 
	(true (cell 12 5 a)) 
	(true (whitedone 30))
	(true (step ?x)))
(<= (next (whitedone 30)) (not (true (cell 12 5 a))))
(<= (next (whitedone ?x))
	(true (cell 12 5 a))
	(not (true (whitedone 30)))
	(true (whitedone ?x)))
(<= (next (blackdone ?x)) 
	(true (cell 2 5 b)) 
	(true (blackdone 30))
	(true (step ?x)))
(<= (next (blackdone 30)) (not (true (cell  2 5 b))))
(<= (next (blackdone ?x))
	(true (cell 2 5 b))
	(not (true (blackdone 30)))
	(true (blackdone ?x)))


(<= (goal white 100)
    (true (cell 12 5 a))
    (not (true (cell 2 5 b))))

(<= (goal black 0)
    (not (true (cell 2 5 b))))

(<= (goal black 100)
    (true (cell 2 5 b))
    (not (true (cell 12 5 a))))

(<= (goal white 0)
    (not (true (cell 12 5 a))))

(<= (goal white 75)
    (true (cell 2 5 b))
    (true (cell 12 5 a))
    (true (blackdone ?x))
    (true (whitedone ?y))
    (greaterthan ?x ?y))

(<= (goal black 25)
    (true (cell 2 5 b))
    (true (cell 12 5 a))
    (true (blackdone ?x))
    (true (whitedone ?y))
    (greaterthan ?x ?y))

(<= (goal white 25)
    (true (cell 2 5 b))
    (true (cell 12 5 a))
    (true (blackdone ?x))
    (true (whitedone ?y))
    (greaterthan ?y ?x))

(<= (goal black 75)
    (true (cell 2 5 b))
    (true (cell 12 5 a))
    (true (blackdone ?x))
    (true (whitedone ?y))
    (greaterthan ?y ?x))

(<= (goal black 50)
    (true (cell 2 5 b))
    (true (cell 12 5 a))
    (true (blackdone ?x))
    (true (whitedone ?x)))

(<= (goal white 50)
    (true (cell 2 5 b))
    (true (cell 12 5 a))
    (true (blackdone ?x))
    (true (whitedone ?x)))

(<= terminal (true (step 30)))
(<= terminal 
	(true (cell 2 5 b))
	(true (cell 12 5 a)))

sees_XML(...) rules

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