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

Game Description

(role red)
(role yellow)
(role blue)
(role green)
(init (control red))
(init (cell 1 4 red))
(init (cell 4 1 yellow))
(init (cell 7 4 blue))
(init (cell 4 7 green))
(init (pieces red 1))
(init (pieces yellow 1))
(init (pieces blue 1))
(init (pieces green 1))
(init (step 1))

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

(<= (legal ?player (move ?x1 ?y1 ?x2 ?y2))
    (true (control ?player))
    (true (cell ?x1 ?y1 ?player))
    (moveto ?x1 ?y1 ?x2 ?y2 ?player))

(<= (captureto ?x1 ?y1 ?x2 ?y2)
    (orthogonal ?x1 ?y1 ?x2 ?y2))
(<= (captureto ?x1 ?y1 ?x2 ?y2)
    (diagonal ?x1 ?y1 ?x2 ?y2))

(<= (moveto ?x1 ?y1 ?x2 ?y2 ?player)
	(captureto ?x1 ?y1 ?x2 ?y2)
    (true (cell ?x2 ?y2 ?player2))
    (distinct ?player ?player2)
    (distinct ?x2 1)
    (distinct ?x2 7)
    (distinct ?y2 1)
    (distinct ?y2 7)
   	(role ?player))

(<= (moveto ?x1 ?y1 ?x2 ?y2 ?player)
	(ell ?x1 ?y1 ?x2 ?y2)
    (distinct ?x2 1)
    (distinct ?x2 7)
    (distinct ?y2 1)
    (distinct ?y2 7)
	(not (any_cell ?x2 ?y2))
	(role ?player))

(<= (next (control ?p2))
    (true (control ?p1))
    (rotation ?p1 ?p2))
    
(<= (next (cell ?x2 ?y2 ?player))
    (does ?player (move ?x1 ?y1 ?x2 ?y2)))
    
(<= (next (cell ?x ?y ?piece))
    (true (cell ?x ?y ?piece))
    (not (camefrom ?x ?y))
    (not (wentto ?x ?y)))
    
(<= (next (cell ?x ?y ?player))
    (spawns ?x ?y ?player))
    
(<= (next (step ?t2))
    (true (step ?t1))
    (succ ?t1 ?t2))

(<= (next (pieces ?p ?n))
	(spawned ?p)
	(true (pieces ?p ?n1))
	(succ ?n1 ?n))
	
(<= (next (pieces ?p ?n))
	(captured ?p)
	(true (pieces ?p ?n1))
	(succ ?n ?n1))

(<= (next (pieces ?p ?n))
	(true (pieces ?p ?n))
	(not (spawned ?p))
	(not (captured ?p)))

(<= (captured ?p)
	(does ?p2 (move ?x1 ?y1 ?x2 ?y2))
	(true (cell ?x2 ?y2 ?p))
	(distinct ?p2 ?p))

(<= (spawned ?p)
	(does ?p (move ?x1 ?y1 ?x2 ?y2))
	(spawns ?x1 ?y1 ?p))


(<= terminal
    (role ?player)
    (line ?player))
    
(<= terminal
    (true (step 33)))
    
(<= (goal ?player ?v)
    (role ?player)
    (not (line ?player))
    (true (pieces ?player ?n))
    (pieces_value_map ?n ?v))
    
(<= (goal ?player 100)
    (role ?player)
    (line ?player))

(pieces_value_map 0 0)
(pieces_value_map 1 10)
(pieces_value_map 2 20)
(pieces_value_map 3 30)
(pieces_value_map 4 40)
(pieces_value_map 5 50)
(pieces_value_map 6 60)
(pieces_value_map 7 70)
(pieces_value_map 8 80)
(pieces_value_map 9 90)
(pieces_value_map 10 99)
(pieces_value_map 11 99)
(pieces_value_map 12 99)
(pieces_value_map 13 99)
(pieces_value_map 14 99)
(pieces_value_map 15 99)
(pieces_value_map 16 99)
(pieces_value_map 17 99)
(pieces_value_map 18 99)
(pieces_value_map 19 99)
(pieces_value_map 20 99)
(pieces_value_map 21 99)
(pieces_value_map 22 99)
(pieces_value_map 23 99)
(pieces_value_map 24 99)
(pieces_value_map 25 99)
(pieces_value_map 26 99)
    
(<= (orthogonal ?x1 ?y ?x2 ?y)
    (adjacent1 ?x1 ?x2)
    (index ?y))
(<= (orthogonal ?x ?y1 ?x ?y2)
    (adjacent1 ?y1 ?y2)
    (index ?x))

(<= (diagonal ?x1 ?y1 ?x2 ?y2)
    (adjacent1 ?x1 ?x2)
    (adjacent1 ?y1 ?y2))

(<= (ell ?x1 ?y1 ?x2 ?y2)
    (adjacent2 ?x1 ?x2)
    (adjacent1 ?y1 ?y2))
(<= (ell ?x1 ?y1 ?x2 ?y2)
    (adjacent2 ?y1 ?y2)
    (adjacent1 ?x1 ?x2))

(<= (any_cell ?x ?y)
	(true (cell ?x ?y ?p)))

(<= (camefrom ?x1 ?y1)
    (does ?player (move ?x1 ?y1 ?x2 ?y2)))
    
(<= (wentto ?x2 ?y2)
    (does ?player (move ?x1 ?y1 ?x2 ?y2)))
    
(<= (line ?player)
    (row ?player))
(<= (line ?player)
    (column ?player))
(<= (line ?player)
    (diag ?player))
    
(<= (row ?player)
    (true (cell 3 3 ?player))
    (true (cell 4 3 ?player))
    (true (cell 5 3 ?player)))
(<= (row ?player)
    (true (cell 3 4 ?player))
    (true (cell 4 4 ?player))
    (true (cell 5 4 ?player)))
(<= (row ?player)
    (true (cell 3 5 ?player))
    (true (cell 4 5 ?player))
    (true (cell 5 5 ?player)))
(<= (column ?player)
    (true (cell 3 3 ?player))
    (true (cell 3 4 ?player))
    (true (cell 3 5 ?player)))
(<= (column ?player)
    (true (cell 4 3 ?player))
    (true (cell 4 4 ?player))
    (true (cell 4 5 ?player)))
(<= (column ?player)
    (true (cell 5 3 ?player))
    (true (cell 5 4 ?player))
    (true (cell 5 5 ?player)))
(<= (diag ?player)
    (true (cell 3 3 ?player))
    (true (cell 4 4 ?player))
    (true (cell 5 5 ?player)))
(<= (diag ?player)
    (true (cell 3 5 ?player))
    (true (cell 4 4 ?player))
    (true (cell 5 3 ?player)))
    
(index 1)
(index 2)
(index 3)
(index 4)
(index 5)
(index 6)
(index 7)

(plus1 1 2)
(plus1 2 3)
(plus1 3 4)
(plus1 4 5)
(plus1 5 6)
(plus1 6 7)

(<= (adjacent1 ?x1 ?x2)
	(plus1 ?x1 ?x2))
(<= (adjacent1 ?x1 ?x2)
	(plus1 ?x2 ?x1))
	
(plus2 1 3)
(plus2 2 4)
(plus2 3 5)
(plus2 4 6)
(plus2 5 7)

(<= (adjacent2 ?x1 ?x2)
	(plus2 ?x1 ?x2))
(<= (adjacent2 ?x1 ?x2)
	(plus2 ?x2 ?x1))

(rotation red yellow)
(rotation yellow blue)
(rotation blue green)
(rotation green red)

(spawns 1 4 red)
(spawns 4 1 yellow)
(spawns 7 4 blue)
(spawns 4 7 green)

(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)

sees_XML(...) rules

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