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

Game Description

; start with tictactoe, and then when it is finished, move to blocker

(role xcplayer)
(role obplayer)
(init (cell 1 1 b))
(init (cell 1 2 b))
(init (cell 1 3 b))
(init (cell 2 1 b))
(init (cell 2 2 b))
(init (cell 2 3 b))
(init (cell 3 1 b))
(init (cell 3 2 b))
(init (cell 3 3 b))
(init (control xcplayer))

; after reset, change state to init of blocker and store the scores in the state

(<= (next (cellb 1 1 b)) (does ?p reset) (role ?p))
(<= (next (cellb 1 2 b)) (does ?p reset) (role ?p))
(<= (next (cellb 1 3 b)) (does ?p reset) (role ?p))
(<= (next (cellb 1 4 b)) (does ?p reset) (role ?p))
(<= (next (cellb 2 1 b)) (does ?p reset) (role ?p))
(<= (next (cellb 2 2 b)) (does ?p reset) (role ?p))
(<= (next (cellb 2 3 b)) (does ?p reset) (role ?p))
(<= (next (cellb 2 4 b)) (does ?p reset) (role ?p))
(<= (next (cellb 3 1 b)) (does ?p reset) (role ?p))
(<= (next (cellb 3 2 b)) (does ?p reset) (role ?p))
(<= (next (cellb 3 3 b)) (does ?p reset) (role ?p))
(<= (next (cellb 3 4 b)) (does ?p reset) (role ?p))
(<= (next (cellb 4 1 b)) (does ?p reset) (role ?p))
(<= (next (cellb 4 2 b)) (does ?p reset) (role ?p))
(<= (next (cellb 4 3 b)) (does ?p reset) (role ?p))
(<= (next (cellb 4 4 b)) (does ?p reset) (role ?p))

(<= (next (ticscores ?x ?y)) (does ?p reset) (role ?p) (finishedtic ?x ?y))
(<= (next (ticscores ?x ?y)) (true (ticscores ?x ?y)))

(<= (next (cell ?m ?n x))
    (does xcplayer (mark ?m ?n))
    (true (cell ?m ?n b))
    (not reseted))
(<= (next (cell ?m ?n o))
    (does obplayer (mark ?m ?n))
    (true (cell ?m ?n b))
    (not reseted))
(<= (next (cell ?m ?n ?w))
    (true (cell ?m ?n ?w))
    (distinct ?w b)
    (not reseted))
(<= (next (cell ?m ?n b))
    (does ?w (mark ?j ?k))
    (true (cell ?m ?n b))
    (or (distinct ?m ?j) (distinct ?n ?k))
    (not reseted))
(<= (next (control xcplayer))
    (true (control obplayer))
    (not reseted))
(<= (next (control obplayer))
    (true (control xcplayer))
    (not reseted))
(<= (row ?m ?x)
    (true (cell ?m 1 ?x))
    (true (cell ?m 2 ?x))
    (true (cell ?m 3 ?x)))
(<= (column ?n ?x)
    (true (cell 1 ?n ?x))
    (true (cell 2 ?n ?x))
    (true (cell 3 ?n ?x)))
(<= (diagonal ?x)
    (true (cell 1 1 ?x))
    (true (cell 2 2 ?x))
    (true (cell 3 3 ?x)))
(<= (diagonal ?x)
    (true (cell 1 3 ?x))
    (true (cell 2 2 ?x))
    (true (cell 3 1 ?x)))
(<= (line ?x)
    (row ?m ?x))
(<= (line ?x)
    (column ?m ?x))
(<= (line ?x)
    (diagonal ?x))
(<= open
    (true (cell ?m ?n b)))
(<= reseted
	(does ?p reset))
(<= ticscorz
	(true (ticscores ?x ?y)))

(<= (legal ?w (mark ?x ?y))
	(not fintic)
    (true (cell ?x ?y b))
    (true (control ?w)))
(<= (legal xcplayer noop)
	(not fintic)
    (true (control obplayer)))
(<= (legal obplayer noop)
	(not fintic)
    (true (control xcplayer)))
(<= (legal ?r reset)
    (role ?r)
    fintic
    (not ticscorz))


(<= (goaltic xcplayer 50)
    (line x))
(<= (goaltic xcplayer 25)
    (not (line x))
    (not (line o))
    (not open))
(<= (goaltic xcplayer 0)
    (line o))
(<= (goaltic obplayer 50)
    (line o))
(<= (goaltic obplayer 25)
    (not (line x))
    (not (line o))
    (not open))
(<= (goaltic obplayer 0)
    (line x))

(<= fintic
	(finishedtic ?x ?y))

(<= (finishedtic ?x ?y)
    (line x)
    (goaltic xcplayer ?x)
    (goaltic obplayer ?y))
(<= (finishedtic ?x ?y)
    (line o)    
    (goaltic xcplayer ?x)
    (goaltic obplayer ?y))
(<= (finishedtic ?x ?y)
    (not open)
    (goaltic xcplayer ?x)
    (goaltic obplayer ?y))


    
;;;;;;;;;;;;;;;; blocker

(<= (next (cellb ?m ?n blk))
    (does obplayer (mark ?m ?n))
    (true (cellb ?m ?n b)))
(<= (next (cellb ?m ?n xcplayer))
    (does xcplayer (mark ?m ?n))
    (not (does obplayer (mark ?m ?n)))
    (true (cellb ?m ?n b)))
(<= (next (cellb ?m ?n ?x))
    (true (cellb ?m ?n ?x))
    (distinct ?x b))
(<= (next (cellb ?m ?n b))
    (true (cellb ?m ?n b))
    (not (does obplayer (mark ?m ?n)))
    (not (does xcplayer (mark ?m ?n))))
(cont 1 1)
(cont 2 2)
(cont 3 3)
(cont 4 4)
(cont 1 2)
(cont 2 3)
(cont 3 4)
(cont 2 1)
(cont 3 2)
(cont 4 3)
(<= bridge
    (true (cellb 1 ?a xcplayer))
    (cont ?a ?b)
    (true (cellb 2 ?b xcplayer))
    (cont ?b ?c)
    (true (cellb 3 ?c xcplayer))
    (cont ?c ?d)
    (true (cellb 4 ?d xcplayer)))
(<= openb
    (true (cellb ?m ?n b)))
(<= (legal ?who (mark ?x ?y))
    (not finishedbloc)
    (true (cellb ?x ?y b))
    (role ?who))

(<= (goalbloc xcplayer 50)
    bridge)
(<= (goalbloc obplayer 0)
    bridge)
(<= (goalbloc xcplayer 0)
    (not bridge))
(<= (goalbloc obplayer 50)
    (not bridge))

(<= finishedbloc
    bridge)
(<= finishedbloc
    (not openb))

(<= terminal
	ticscorz
    finishedbloc)
(<= (goal xcplayer ?x)
    (true (ticscores ?xc ?ob))
    (goalbloc xcplayer ?y)
    (sum ?xc ?y ?x))
(<= (goal obplayer ?x)
    (true (ticscores ?xc ?ob))
    (goalbloc obplayer ?y)
    (sum ?ob ?y ?x))

(sum 0 0 0)
(sum 0 25 25)
(sum 0 50 50)
(sum 25 0 25)
(sum 25 25 50)
(sum 25 50 75)
(sum 50 0 50)
(sum 50 25 75)
(sum 50 50 100)

sees_XML(...) rules

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

; keep these fluents
(<= (sees_xml1 (cell ?x ?y ?c)) (true (cell ?x ?y ?c)))
(<= (sees_xml1 (control ?p)) (true (control ?p)))
(<= (sees_xml1 (ticscores ?x ?y)) (true (ticscores ?x ?y)))

; rename the cell contents of the blocker cells
(<= (sees_xml1 (cellb ?x ?y x)) (true (cellb ?x ?y xcplayer)))
(<= (sees_xml1 (cellb ?x ?y o)) (true (cellb ?x ?y blk)))
(<= (sees_xml1 (cellb ?x ?y b)) (true (cellb ?x ?y b)))
(<= (sees_xml1 (cellb 0 ?y x)) (true (cellb ?x ?y ?c)))
(<= (sees_xml1 (cellb 5 ?y x)) (true (cellb ?x ?y ?c)))
(<= (sees_xml1 (cellb ?x 0 o)) (true (cellb ?x ?y ?c)))
(<= (sees_xml1 (cellb ?x 5 o)) (true (cellb ?x ?y ?c)))