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

Game Description

;;
;; 1 player mummy maze
;;  Tyler Hicks-Wright, Eric Schkufza
;;

;; OBJECTS (Components)

(index 0)
(index 1)
(index 2)
(index 3)
(index 4)
(index 5)
(index 6)
(index 7)
(index 8)

(direction north)
(direction south)
(direction east)
(direction west)
(direction nowhere)	

(role explorer)

(mummy-type mummy)

;; INITIAL STATE (Configuration)

(init (location mummy 5 1))
(init (location explorer 3 3))
(init (location exit 1 2))
(init (step 0))

(init (wall 4 1 east))
(init (wall 4 1 north))
(init (wall 1 2 north))
(init (wall 2 2 north))
(init (wall 1 3 east))
(init (wall 3 3 east))
(init (wall 2 4 east))
(init (wall 3 4 east))
(init (wall 3 5 east))
(init (wall 3 5 north))
(init (wall 2 5 north))
(init (wall 2 6 east))
(init (wall 3 6 north))
(init (wall 2 8 east))
(init (wall 4 6 north))
(init (wall 4 7 east))
(init (wall 5 7 east))
(init (wall 4 4 east))
(init (wall 5 4 east))
(init (wall 8 7 north))
(init (wall 6 1 north))
(init (wall 6 2 north))
(init (wall 6 2 east))
(init (wall 6 3 east))
(init (wall 6 4 east))
(init (wall 6 6 north))
(init (wall 7 4 north))
(init (wall 7 3 east))

(init (wall 1 0 north))
(init (wall 2 0 north))
(init (wall 3 0 north))
(init (wall 4 0 north))
(init (wall 5 0 north))
(init (wall 6 0 north))
(init (wall 7 0 north))
(init (wall 8 0 north))
(init (wall 1 8 north))
(init (wall 2 8 north))
(init (wall 3 8 north))
(init (wall 4 8 north))
(init (wall 5 8 north))
(init (wall 6 8 north))
(init (wall 7 8 north))
(init (wall 8 8 north))
(init (wall 0 1 east))
(init (wall 0 2 east))
(init (wall 0 3 east))
(init (wall 0 4 east))
(init (wall 0 5 east))
(init (wall 0 6 east))
(init (wall 0 7 east))
(init (wall 0 8 east))
(init (wall 8 1 east))
(init (wall 8 2 east))
(init (wall 8 3 east))
(init (wall 8 4 east))
(init (wall 8 5 east))
(init (wall 8 6 east))
(init (wall 8 7 east))
(init (wall 8 8 east))

;; ACTIONS

(<= (legal explorer (move ?dir))
 	(direction ?dir))

   ; built in object actions define doesprime    
  (<= (doesprime ?mummy (move2 ?m1 ?m2))
  	  (mummy-type ?mummy)
  	  (true (location ?mummy ?x ?y))
	  (true (location explorer ?ex1 ?ey1))
	  (does explorer (move ?em))
	  (newlocation1 ?ex1 ?ey1 ?em ?ex ?ey)
  	  (movetoward ?x ?y ?ex ?ey ?m1)
  	  (newlocation1 ?x ?y ?m1 ?x1 ?y1)
  	  (movetoward ?x1 ?y1 ?ex ?ey ?m2))
  	  
  (<= (movetoward ?x ?y ?ex ?ey ?card)
  	  (direction-from ?x ?y ?ex ?ey ?dir)
  	  (pick-one ?x ?y ?dir ?card))
	  
  ; no horizontal or vertical component
  (<= (pick-one ?x ?y none nowhere)
      (index ?x)
      (index ?y))

  ; no horizontal component
  (<= (pick-one ?x ?y ?dir ?v)
  	  (index ?x)
  	  (index ?y)
      (not (some-horiz-component ?dir))
      (vert-component ?dir ?v))

  ; no vertical component
  (<= (pick-one ?x ?y ?dir ?h)
      (index ?x)
      (index ?y)
  	  (not (some-vert-component ?dir))
  	  (horiz-component ?dir ?h))
  	  
  ; both vertical and horizontal components, where horiz moves piece
  (<= (pick-one ?x ?y ?dir ?h)
      (horiz-component ?dir ?h)
      (vert-component ?dir ?v)
      (newlocation1 ?x ?y ?h ?xnew ?y)
      (distinct ?x ?xnew))
      
  ; both vertical and horizontal components, where horiz does not move piece.
  ;   if horiz doesn't move, either vertical does move or it does not.
  ;     either way, pick the vertical.
  (<= (pick-one ?x ?y ?dir ?v)
      (horiz-component ?dir ?h)
      (vert-component ?dir ?v)
      (newlocation1 ?x ?y ?h ?x ?y))
      
      
  (<= (some-vert-component ?dir)
      (vert-component ?dir ?x))

  (<= (some-horiz-component ?dir)
      (horiz-component ?dir ?x))

  (<= (direction-from ?x1 ?y1 ?x2 ?y2 ?dir)
      (horiz-direction-from ?x1 ?x2 ?dir1)
      (vert-direction-from ?y1 ?y2 ?dir2)
      (combine-directions ?dir2 ?dir1 ?dir))

  (<= (horiz-direction-from ?x1 ?x2 east)
      (lessthan ?x1 ?x2))
  (<= (horiz-direction-from ?x1 ?x2 west)
      (lessthan ?x2 ?x1))
  (<= (horiz-direction-from ?x1 ?x2 none)
      (index ?x1)
      (index ?x2)
      (not (lessthan ?x1 ?x2))
      (not (lessthan ?x2 ?x1)))

  (<= (vert-direction-from ?y1 ?y2 north)
      (lessthan ?y1 ?y2))
  (<= (vert-direction-from ?y1 ?y2 south)
      (lessthan ?y2 ?y1))
  (<= (vert-direction-from ?y1 ?y2 none)
      (index ?y1)
      (index ?y2)
      (not (lessthan ?y1 ?y2))
      (not (lessthan ?y2 ?y1)))

  (combine-directions none none none)
  (<= (combine-directions none ?x ?x)
      (direction ?x))
  (<= (combine-directions ?x none ?x)
      (direction ?x))
  (combine-directions north east ne)
  (combine-directions north west nw)
  (combine-directions south east se)
  (combine-directions south west sw)

  (<= (lessthan ?x ?y)
  	  (succ ?x ?y))
  (<= (lessthan ?x ?y)
  	  (distinct ?x ?y)
  	  (succ ?x ?z)
  	  (lessthan ?z ?y))


;; DYNAMICS

(<= (next (location explorer ?x2 ?y2))
 	(true (location explorer ?x1 ?y1))
	(does explorer (move ?dir))
	(newlocation1 ?x1 ?y1 ?dir ?x2 ?y2))
(<= (next (location ?mummy ?x2 ?y2))
	(mummy-type ?mummy)
	(true (location ?mummy ?x1 ?y1))
   	(doesprime ?mummy (move2 ?dir1 ?dir2))
	(newlocation2 ?x1 ?y1 ?dir1 ?dir2 ?x2 ?y2))	
	
;; FRAME AXIOMS

(<= (next (location exit ?x ?y))
 	(true (location exit ?x ?y)))
(<= (next (wall ?x ?y ?z))
	(true (wall ?x ?y ?z))) 

;; STEP AXIOMS

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

(<= eaten
 	(true (location explorer ?x ?y))
	(true (location ?mummy ?x ?y))
	(mummy-type ?mummy))
(<= atexit
 	(true (location explorer ?x ?y))
	(true (location exit ?x ?y)))
(<= laststep
 	(true (step 50)))

;; COMPUTATIONAL RELATIONS
(<= (newlocation1 ?x ?y nowhere ?x ?y)
 	(index ?x)
	(index ?y))
	
(<= (newlocation1 ?x ?y north ?x ?y)
	(true (wall ?x ?y north)))
(<= (newlocation1 ?x ?y south ?x ?y)
 	(succ ?down ?y)
	(true (wall ?x ?down north)))
(<= (newlocation1 ?x ?y east ?x ?y)
	(true (wall ?x ?y east)))
(<= (newlocation1 ?x ?y west ?x ?y)
	(succ ?left ?x)
	(true (wall ?left ?y east)))

(<= (newlocation1 ?x ?y1 north ?x ?y2)
	(succ ?y1 ?y2)
	(index ?x)
	(not (true (wall ?x ?y1 north))))
(<= (newlocation1 ?x ?y1 south ?x ?y2)
	(succ ?y2 ?y1)
	(index ?x)
	(not (true (wall ?x ?y2 north))))
(<= (newlocation1 ?x1 ?y east ?x2 ?y)
	(succ ?x1 ?x2)
	(index ?y)
	(not (true (wall ?x1 ?y east))))
(<= (newlocation1 ?x1 ?y west ?x2 ?y)
	(succ ?x2 ?x1)
	(index ?y)
	(not (true (wall ?x2 ?y east))))

(<= (newlocation2 ?x1 ?y1 ?dir1 ?dir2 ?x3 ?y3)
	(newlocation1 ?x1 ?y1 ?dir1 ?x2 ?y2)
   	(newlocation1 ?x2 ?y2 ?dir2 ?x3 ?y3))	
	
;; STATIC RELATIONS

(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)
(succ 31 32)
(succ 32 33)
(succ 33 34)
(succ 34 35)
(succ 35 36)
(succ 36 37)
(succ 37 38)
(succ 38 39)
(succ 39 40)
(succ 40 41)
(succ 41 42)
(succ 42 43)
(succ 43 44)
(succ 44 45)
(succ 45 46)
(succ 46 47)
(succ 47 48)
(succ 48 49)
(succ 49 50)

  (horiz-component nw west)
  (horiz-component ne east)
  (horiz-component sw west)
  (horiz-component se east)
  (vert-component nw north)
  (vert-component ne north)
  (vert-component sw south)
  (vert-component se south)
  (horiz-component west west)
  (horiz-component east east)
  (vert-component north north)
  (vert-component south south)


;; TERMINAL CONDITIONS

(<= terminal laststep)
(<= terminal eaten)
(<= terminal atexit)

;; GOAL VALUES
(<= (goal explorer 100)
 	atexit
	(not eaten))
(<= (goal explorer 50)
	(not atexit)
   	(not eaten))
(<= (goal explorer 0)
	eaten)

(<= (goal mummy 0)
 	atexit
	(not eaten))
(<= (goal mummy 50)
	(not atexit)
   	(not eaten))
(<= (goal mummy 100)
	eaten) 

sees_XML(...) rules

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