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

Game Description

; asteroids
(role ship)
(init (x 10))
(init (y 10))
(init (heading north))
(init (north-speed 3))
(init (east-speed 2))
(init (step 1))
(<= (legal ship thrust))
(<= (legal ship (turn clock)))
(<= (legal ship (turn counter)))
(<= (next (heading ?h))
    (true (heading ?h))
    (does ship thrust))
(<= (next (heading west))
    (true (heading north))
    (does ship (turn counter)))
(<= (next (heading south))
    (true (heading west))
    (does ship (turn counter)))
(<= (next (heading east))
    (true (heading south))
    (does ship (turn counter)))
(<= (next (heading north))
    (true (heading east))
    (does ship (turn counter)))
(<= (next (heading east))
    (true (heading north))
    (does ship (turn clock)))
(<= (next (heading south))
    (true (heading east))
    (does ship (turn clock)))
(<= (next (heading west))
    (true (heading south))
    (does ship (turn clock)))
(<= (next (heading north))
    (true (heading west))
    (does ship (turn clock)))
(<= (next (north-speed ?s))
    (true (north-speed ?s))
    (does ship (turn clock)))
(<= (next (north-speed ?s))
    (true (north-speed ?s))
    (does ship (turn counter)))
(<= (next (north-speed ?s))
    (true (north-speed ?s))
    (true (heading east)))
(<= (next (north-speed ?s))
    (true (north-speed ?s))
    (true (heading west)))
(<= (next (north-speed ?s2))
    (true (north-speed ?s1))
    (true (heading north))
    (does ship thrust)
    (speed+ ?s1 ?s2))
(<= (next (north-speed ?s2))
    (true (north-speed ?s1))
    (true (heading south))
    (does ship thrust)
    (speed- ?s1 ?s2))
(<= (next (east-speed ?s))
    (true (east-speed ?s))
    (does ship (turn clock)))
(<= (next (east-speed ?s))
    (true (east-speed ?s))
    (does ship (turn counter)))
(<= (next (east-speed ?s))
    (true (east-speed ?s))
    (true (heading north)))
(<= (next (east-speed ?s))
    (true (east-speed ?s))
    (true (heading south)))
(<= (next (east-speed ?s2))
    (true (east-speed ?s1))
    (true (heading east))
    (does ship thrust)
    (speed+ ?s1 ?s2))
(<= (next (east-speed ?s2))
    (true (east-speed ?s1))
    (true (heading west))
    (does ship thrust)
    (speed- ?s1 ?s2))
(<= (next (x ?new))
    (true (x ?old))
    (true (east-speed ?s))
    (map+ ?old ?s ?new))
(<= (next (y ?new))
    (true (y ?old))
    (true (north-speed ?s))
    (map+ ?old ?s ?new))
(<= (next (step ?n++))
    (true (step ?n))
    (succ ?n ?n++))
(<= terminal
    stopped)
(<= terminal
    timeout)
(<= (goal ship 100)
    stopped
    atplanet)
(<= (goal ship 50)
    stopped
    (not atplanet))
(<= (goal ship 0)
    (not stopped))
(<= stopped
    (true (north-speed 0))
    (true (east-speed 0)))
(<= atplanet
    (true (x 15))
    (true (y 5)))
(<= timeout
    (true (step 50)))
(map+ 20 -3 17)
(map+ 20 -2 18)
(map+ 20 -1 19)
(map+ 20 0 20)
(map+ 20 1 1)
(map+ 20 2 2)
(map+ 20 3 3)
(map+ 19 -3 16)
(map+ 19 -2 17)
(map+ 19 -1 18)
(map+ 19 0 19)
(map+ 19 1 20)
(map+ 19 2 1)
(map+ 19 3 2)
(map+ 18 -3 15)
(map+ 18 -2 16)
(map+ 18 -1 17)
(map+ 18 0 18)
(map+ 18 1 19)
(map+ 18 2 20)
(map+ 18 3 1)
(map+ 17 -3 14)
(map+ 17 -2 15)
(map+ 17 -1 16)
(map+ 17 0 17)
(map+ 17 1 18)
(map+ 17 2 19)
(map+ 17 3 20)
(map+ 16 -3 13)
(map+ 16 -2 14)
(map+ 16 -1 15)
(map+ 16 0 16)
(map+ 16 1 17)
(map+ 16 2 18)
(map+ 16 3 19)
(map+ 15 -3 12)
(map+ 15 -2 13)
(map+ 15 -1 14)
(map+ 15 0 15)
(map+ 15 1 16)
(map+ 15 2 17)
(map+ 15 3 18)
(map+ 14 -3 11)
(map+ 14 -2 12)
(map+ 14 -1 13)
(map+ 14 0 14)
(map+ 14 1 15)
(map+ 14 2 16)
(map+ 14 3 17)
(map+ 13 -3 10)
(map+ 13 -2 11)
(map+ 13 -1 12)
(map+ 13 0 13)
(map+ 13 1 14)
(map+ 13 2 15)
(map+ 13 3 16)
(map+ 12 -3 9)
(map+ 12 -2 10)
(map+ 12 -1 11)
(map+ 12 0 12)
(map+ 12 1 13)
(map+ 12 2 14)
(map+ 12 3 15)
(map+ 11 -3 8)
(map+ 11 -2 9)
(map+ 11 -1 10)
(map+ 11 0 11)
(map+ 11 1 12)
(map+ 11 2 13)
(map+ 11 3 14)
(map+ 10 -3 7)
(map+ 10 -2 8)
(map+ 10 -1 9)
(map+ 10 0 10)
(map+ 10 1 11)
(map+ 10 2 12)
(map+ 10 3 13)
(map+ 9 -3 6)
(map+ 9 -2 7)
(map+ 9 -1 8)
(map+ 9 0 9)
(map+ 9 1 10)
(map+ 9 2 11)
(map+ 9 3 12)
(map+ 8 -3 5)
(map+ 8 -2 6)
(map+ 8 -1 7)
(map+ 8 0 8)
(map+ 8 1 9)
(map+ 8 2 10)
(map+ 8 3 11)
(map+ 7 -3 4)
(map+ 7 -2 5)
(map+ 7 -1 6)
(map+ 7 0 7)
(map+ 7 1 8)
(map+ 7 2 9)
(map+ 7 3 10)
(map+ 6 -3 3)
(map+ 6 -2 4)
(map+ 6 -1 5)
(map+ 6 0 6)
(map+ 6 1 7)
(map+ 6 2 8)
(map+ 6 3 9)
(map+ 5 -3 2)
(map+ 5 -2 3)
(map+ 5 -1 4)
(map+ 5 0 5)
(map+ 5 1 6)
(map+ 5 2 7)
(map+ 5 3 8)
(map+ 4 -3 1)
(map+ 4 -2 2)
(map+ 4 -1 3)
(map+ 4 0 4)
(map+ 4 1 5)
(map+ 4 2 6)
(map+ 4 3 7)
(map+ 3 -3 20)
(map+ 3 -2 1)
(map+ 3 -1 2)
(map+ 3 0 3)
(map+ 3 1 4)
(map+ 3 2 5)
(map+ 3 3 6)
(map+ 2 -3 19)
(map+ 2 -2 20)
(map+ 2 -1 1)
(map+ 2 0 2)
(map+ 2 1 3)
(map+ 2 2 4)
(map+ 2 3 5)
(map+ 1 -3 18)
(map+ 1 -2 19)
(map+ 1 -1 20)
(map+ 1 0 1)
(map+ 1 1 2)
(map+ 1 2 3)
(map+ 1 3 4)
(speed+ -3 -2)
(speed+ -2 -1)
(speed+ -1 0)
(speed+ 0 1)
(speed+ 1 2)
(speed+ 2 3)
(speed+ 3 3)
(speed- 3 2)
(speed- 2 1)
(speed- 1 0)
(speed- 0 -1)
(speed- -1 -2)
(speed- -2 -3)
(speed- -3 -3)
(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) 

sees_XML(...) rules

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