You are not logged in. login register
Game wargame02
name wargame02
creator stephan
number of roles 1
stylesheet mazegames/mazegames.xsl
GDL v1
enabled
matches show matches
statistics show game statistics
description Escape from the terrorists and capture the flag. The same as wargame01 with the bug fixed that the soldier is invincible.

Game Description

; wargame01 (from http://games.stanford.edu:4441/spectator/Showallrules?Match=WARGAME01)

(role soldier)
(init (location soldier 2 2))
(init (location terrorist1 7 7))
(init (location terrorist2 3 6))
(init (location gun1 7 3))
(init (location gun2 3 1))
(init (location grenade 7 2))
(init (location flag 8 8))
(init (health soldier 1))
(init (health terrorist1 1))
(init (health terrorist2 2))
(init (blockednorth 2 7))
(init (blockednorth 5 7))
(init (blockednorth 6 7))
(init (blockednorth 7 6))
(init (blockednorth 2 5))
(init (blockednorth 3 5))
(init (blockednorth 4 5))
(init (blockednorth 8 5))
(init (blockednorth 2 2))
(init (blockednorth 3 2))
(init (blockednorth 3 2))
(init (blockednorth 6 2))
(init (blockednorth 7 2))
(init (blockednorth 8 2))
(init (blockedeast 1 7))
(init (blockedeast 6 7))
(init (blockedeast 7 6))
(init (blockedeast 1 5))
(init (blockedeast 1 4))
(init (blockedeast 1 3))
(init (blockedeast 3 1))
(init (time 1))
(<= (legal soldier noop))
(<= (legal soldier (step ?dir))
    (true (location soldier ?x ?y))
    (not (stepblocked ?dir ?x ?y))
    (nsteps 1 ?dir ?x ?y ?xany ?yany))
(<= (legal soldier heal)
    (true (holding soldier ?item))
    (type ?item healingitem))
(<= (legal soldier (shoot ?dir))
    (true (holding soldier ?item))
    (type ?item lositem)
    (direction ?dir))
(<= (legal soldier (throw ?dir ?dist))
    (true (holding soldier ?item))
    (type ?item aoeitem)
    (legalthrowdist ?dist)
    (true (location soldier ?x ?y))
    (nsteps ?dist ?dir ?x ?y ?xany ?yany))
(<= (next (blockednorth ?x ?y))
    (true (blockednorth ?x ?y)))
(<= (next (blockedeast ?x ?y))
    (true (blockedeast ?x ?y)))
(<= (next (blastzone ?x ?y))
    (attacks ?x ?y soldier))
(<= (next (location ?character ?x ?y))
    (type ?character animate)
    (intendedlocation ?character ?x ?y))
(<= (next (location ?object ?xo ?yo))
    (type ?object item)
    (true (location ?object ?xo ?yo))
    (intendedlocation soldier ?xe ?ye)
    (distinctcell ?xe ?ye ?xo ?yo))
(<= (next (holding soldier ?object))
    (type ?object item)
    (true (location ?object ?xo ?yo))
    (intendedlocation soldier ?xe ?ye)
    (not (distinctcell ?xe ?ye ?xo ?yo)))
(<= (next (holding soldier ?item))
    (true (holding soldier ?item))
    (not (uses soldier ?item)))
(<= (next (health ?character ?h2))
    (true (health ?character ?h1))
    (healthincrement ?character ?hinc)
    (healthdecrement ?character ?hdec)
    (- ?h1 ?hdec ?h3)
    (+ ?h3 ?hinc ?h2))
(<= (next (time ?tnext))
    (true (time ?tcurrent))
    (+ ?tcurrent 1 ?tnext))
(<= terminal
    timeout)
(<= terminal
    (dead soldier))
(<= terminal
    (true (holding soldier flag)))
(<= (goal soldier 0)
    (dead soldier))
(<= (goal soldier 0)
    (not timeout)
    (not (dead soldier))
    (not (true (holding soldier flag))))
(<= (goal soldier 50)
    timeout
    (not (dead soldier))
    (not (true (holding soldier flag))))
(<= (goal soldier 100)
    (not (dead soldier))
    (true (holding soldier flag)))
(<= (stepblocked n ?x ?y)
    (true (blockednorth ?x ?y)))
(<= (stepblocked s ?x2 ?y2)
    (nsteps 1 n ?x1 ?y1 ?x2 ?y2)
    (true (blockednorth ?x1 ?y1)))
(<= (stepblocked e ?x ?y)
    (true (blockedeast ?x ?y)))
(<= (stepblocked w ?x2 ?y2)
    (nsteps 1 e ?x1 ?y1 ?x2 ?y2)
    (true (blockedeast ?x1 ?y1)))
(<= (pathblocked ?dir ?x1 ?y1 ?x3 ?y3)
    (index ?n)
    (nsteps ?n ?dir ?x1 ?y1 ?x3 ?y3)
    (index ?m)
    (< ?m ?n)
    (nsteps ?m ?dir ?x1 ?y1 ?x2 ?y2)
    (stepblocked ?dir ?x2 ?y2))
(<= (nsteps ?n n ?x ?y1 ?x ?y2)
    (cell ?x ?y1)
    (+ ?y1 ?n ?y2)
    (index ?y2))
(<= (nsteps ?n s ?x ?y1 ?x ?y2)
    (cell ?x ?y1)
    (- ?y1 ?n ?y2)
    (index ?y2))
(<= (nsteps ?n e ?x1 ?y ?x2 ?y)
    (cell ?x1 ?y)
    (+ ?x1 ?n ?x2)
    (index ?x2))
(<= (nsteps ?n w ?x1 ?y ?x2 ?y)
    (cell ?x1 ?y)
    (- ?x1 ?n ?x2)
    (index ?x2))
(<= (verticalrelation n ?x1 ?y1 ?x2 ?y2)
    (cell ?x1 ?y1)
    (cell ?x2 ?y2)
    (> ?y1 ?y2))
(<= (verticalrelation s ?x1 ?y1 ?x2 ?y2)
    (cell ?x1 ?y1)
    (cell ?x2 ?y2)
    (< ?y1 ?y2))
(<= (horizontalrelation e ?x1 ?y1 ?x2 ?y2)
    (cell ?x1 ?y1)
    (cell ?x2 ?y2)
    (> ?x1 ?x2))
(<= (horizontalrelation w ?x1 ?y1 ?x2 ?y2)
    (cell ?x1 ?y1)
    (cell ?x2 ?y2)
    (< ?x1 ?x2))
(<= (legalthrowdist 0))
(<= (legalthrowdist 1))
(<= (legalthrowdist 2))
(<= (uses soldier ?item)
    (type ?item healingitem)
    (does soldier heal))
(<= (uses soldier ?item)
    (type ?item lositem)
    (does soldier (shoot ?dir)))
(<= (uses soldier ?item)
    (type ?item aoeitem)
    (does soldier (throw ?dir ?dist)))
(<= (attacks ?x ?y soldier)
    (does soldier (shoot ?dir))
    (true (location soldier ?x ?y)))
(<= (attacks ?x2 ?y2 soldier)
    (does soldier (shoot ?dir))
    (true (location soldier ?x1 ?y1))
    (index ?n)
    (nsteps ?n ?dir ?x1 ?y1 ?x2 ?y2)
    (not (pathblocked ?dir ?x1 ?y1 ?x2 ?y2)))
(<= (attacks ?x2 ?y2 soldier)
    (does soldier (throw ?dir ?dist))
    (true (location soldier ?x1 ?y1))
    (nsteps ?dist ?dir ?x1 ?y1 ?x2 ?y2))
(<= (attacks ?x3 ?y3 soldier)
    (does soldier (throw ?dir ?dist))
    (true (location soldier ?x1 ?y1))
    (nsteps ?dist ?dir ?x1 ?y1 ?x2 ?y2)
    (nsteps 1 ?dirany ?x2 ?y2 ?x3 ?y3))
(<= (attacks ?x ?y ?terrorist)
    (type ?terrorist terrorist)
    (intendedlocation ?terrorist ?x ?y))
(<= (terroristattacks ?x ?y)
    (type ?terrorist terrorist)
    (attacks ?x ?y ?terrorist))
(<= (intendedlocation soldier ?x2 ?y2)
    (true (location soldier ?x1 ?y1))
    (does soldier (step ?dir))
    (nsteps 1 ?dir ?x1 ?y1 ?x2 ?y2))
(<= (intendedlocation soldier ?x ?y)
    (true (location soldier ?x ?y))
    (not (does soldier (step n)))
    (not (does soldier (step s)))
    (not (does soldier (step e)))
    (not (does soldier (step w))))
(<= (intendedlocation ?terrorist ?x ?y)
    (true (location ?terrorist ?x ?y))
    (type ?terrorist terrorist)
    (dead ?terrorist))
(<= (intendedlocation ?terrorist ?x3 ?y3)
    (type ?terrorist horizontalterrorist)
    (not (dead ?terrorist))
    (intendedlocation soldier ?xs ?ys)
    (true (location ?terrorist ?x1 ?y1))
    (horizontalstep ?x1 ?y1 ?x2 ?y2 ?xs ?ys)
    (horizontalstep ?x2 ?y2 ?x3 ?y3 ?xs ?ys))
(<= (intendedlocation ?terrorist ?x3 ?y3)
    (type ?terrorist verticalterrorist)
    (not (dead ?terrorist))
    (intendedlocation soldier ?xs ?ys)
    (true (location ?terrorist ?x1 ?y1))
    (verticalstep ?x1 ?y1 ?x2 ?y2 ?xs ?ys)
    (verticalstep ?x2 ?y2 ?x3 ?y3 ?xs ?ys))
(<= (horizontalstep ?x1 ?y1 ?x2 ?y2 ?xt ?yt)
    (wouldstephorizontal ?dir ?x1 ?y1 ?xt ?yt)
    (nsteps 1 ?dir ?x1 ?y1 ?x2 ?y2))
(<= (horizontalstep ?x1 ?y1 ?x2 ?y2 ?xt ?yt)
    (wouldstepvertical ?dir ?x1 ?y1 ?xt ?yt)
    (nsteps 1 ?dir ?x1 ?y1 ?x2 ?y2)
    (not (wouldstephorizontal e ?x1 ?y1 ?xt ?yt))
    (not (wouldstephorizontal w ?x1 ?y1 ?xt ?yt)))
(<= (horizontalstep ?x ?y ?x ?y ?xt ?yt)
    (cell ?x ?y)
    (cell ?xt ?yt)
    (not (wouldstephorizontal e ?x ?y ?xt ?yt))
    (not (wouldstephorizontal w ?x ?y ?xt ?yt))
    (not (wouldstepvertical n ?x ?y ?xt ?yt))
    (not (wouldstepvertical s ?x ?y ?xt ?yt)))
(<= (verticalstep ?x1 ?y1 ?x2 ?y2 ?xt ?yt)
    (wouldstepvertical ?dir ?x1 ?y1 ?xt ?yt)
    (nsteps 1 ?dir ?x1 ?y1 ?x2 ?y2))
(<= (verticalstep ?x1 ?y1 ?x2 ?y2 ?xt ?yt)
    (wouldstephorizontal ?dir ?x1 ?y1 ?xt ?yt)
    (nsteps 1 ?dir ?x1 ?y1 ?x2 ?y2)
    (not (wouldstepvertical n ?x1 ?y1 ?xt ?yt))
    (not (wouldstepvertical s ?x1 ?y1 ?xt ?yt)))
(<= (verticalstep ?x ?y ?x ?y ?xt ?yt)
    (cell ?x ?y)
    (cell ?xt ?yt)
    (not (wouldstepvertical n ?x ?y ?xt ?yt))
    (not (wouldstepvertical s ?x ?y ?xt ?yt))
    (not (wouldstephorizontal e ?x ?y ?xt ?yt))
    (not (wouldstephorizontal w ?x ?y ?xt ?yt)))
(<= (wouldstephorizontal ?dir ?x1 ?y1 ?x2 ?y2)
    (horizontalrelation ?dir ?x2 ?y2 ?x1 ?y1)
    (not (stepblocked ?dir ?x1 ?y1)))
(<= (wouldstepvertical ?dir ?x1 ?y1 ?x2 ?y2)
    (verticalrelation ?dir ?x2 ?y2 ?x1 ?y1)
    (not (stepblocked ?dir ?x1 ?y1)))
(<= (healthincrement soldier 1)
    (does soldier heal))
(<= (healthincrement soldier 0)
    (not (does soldier heal)))
(<= (healthdecrement soldier 1)
    (intendedlocation soldier ?x ?y)
    (terroristattacks ?x ?y))
(<= (healthdecrement soldier 0)
    (intendedlocation soldier ?x ?y)
    (not (terroristattacks ?x ?y)))
(<= (healthincrement ?terrorist 0)
    (type ?terrorist terrorist))
(<= (healthdecrement ?terrorist 1)
    (type ?terrorist terrorist)
    (intendedlocation ?terrorist ?x ?y)
    (attacks ?x ?y soldier))
(<= (healthdecrement ?terrorist 0)
    (type ?terrorist terrorist)
    (intendedlocation ?terrorist ?x ?y)
    (not (attacks ?x ?y soldier)))
(<= (dead ?object)
    (true (health ?object 0)))
(<= (distinctcell ?x1 ?y1 ?x2 ?y2)
    (cell ?x1 ?y1)
    (cell ?x2 ?y2)
    (distinct ?x1 ?x2))
(<= (distinctcell ?x1 ?y1 ?x2 ?y2)
    (cell ?x1 ?y1)
    (cell ?x2 ?y2)
    (distinct ?y1 ?y2))
(<= (cell ?x ?y)
    (index ?x)
    (index ?y))
(<= timeout
    (true (time ?t))
    (timefinal ?t))
(index 1)
(index 2)
(index 3)
(index 4)
(index 5)
(index 6)
(index 7)
(index 8)
(direction n)
(direction s)
(direction e)
(direction w)
(timefinal 50)
(type flag item)
(type gun1 item)
(type gun1 lositem)
(type gun2 item)
(type gun2 lositem)
(type grenade item)
(type grenade aoeitem)
(type soldier animate)
(type terrorist1 animate)
(type terrorist1 terrorist)
(type terrorist1 horizontalterrorist)
(type terrorist2 animate)
(type terrorist2 terrorist)
(type terrorist2 horizontalterrorist)
(< 1 2)
(< 1 3)
(< 1 4)
(< 1 5)
(< 1 6)
(< 1 7)
(< 1 8)
(< 2 3)
(< 2 4)
(< 2 5)
(< 2 6)
(< 2 7)
(< 2 8)
(< 3 4)
(< 3 5)
(< 3 6)
(< 3 7)
(< 3 8)
(< 4 5)
(< 4 6)
(< 4 7)
(< 4 8)
(< 5 6)
(< 5 7)
(< 5 8)
(< 6 7)
(< 6 8)
(< 7 8)
(> 8 7)
(> 8 6)
(> 8 5)
(> 8 4)
(> 8 3)
(> 8 2)
(> 8 1)
(> 7 6)
(> 7 5)
(> 7 4)
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