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

Game Description

; othello-comp2007
(role black)
(role red)
(init (cell 4 4 black))
(init (cell 4 5 red))
(init (cell 5 4 red))
(init (cell 5 5 black))
(init (control black))
(<= (legal ?player (mark ?x ?y))
    (true (control ?player))
    (haslegalmoveat ?player ?x ?y))
(<= (legal ?player noop)
    (true (control ?player))
    (not (hasanylegalmove ?player)))
(<= (legal ?player noop)
    (opponent ?player ?opponent)
    (true (control ?opponent)))
(<= (next (cell ?x ?y ?player))
    (does ?player (mark ?x ?y)))
(<= (next (cell ?x ?y ?player))
    (true (cell ?x ?y ?player))
    (opponent ?player ?opponent)
    (does ?opponent noop))
(<= (next (cell ?xp ?yp ?player))
    (true (cell ?xp ?yp ?player))
    (opponent ?player ?opponent)
    (does ?opponent (mark ?xo ?yo))
    (not (playwillflip ?opponent ?xo ?yo ?player ?xp ?yp)))
(<= (next (cell ?xp ?yp ?opponent))
    (true (cell ?xp ?yp ?player))
    (opponent ?player ?opponent)
    (does ?opponent (mark ?xo ?yo))
    (playwillflip ?opponent ?xo ?yo ?player ?xp ?yp))
(<= (next (control black))
    (true (control red)))
(<= (next (control red))
    (true (control black)))
(<= terminal
    gameover)
(<= (goal black 0)
    (not gameover))
(<= (goal black 100)
    gameover
    (tally ?black ?red)
    (lessthan ?red ?black))
(<= (goal black 50)
    gameover
    (tally ?black ?red)
    (not (distinct ?black ?red)))
(<= (goal black 0)
    gameover
    (tally ?black ?red)
    (lessthan ?black ?red))
(<= (goal red 0)
    (not gameover))
(<= (goal red 100)
    gameover
    (tally ?black ?red)
    (lessthan ?black ?red))
(<= (goal red 50)
    gameover
    (tally ?black ?red)
    (not (distinct ?black ?red)))
(<= (goal red 0)
    gameover
    (tally ?black ?red)
    (lessthan ?red ?black))
(<= (cellopen ?x ?y)
    (index ?x)
    (index ?y)
    (not (true (cell ?x ?y black)))
    (not (true (cell ?x ?y red))))
(<= (nextcell n ?x ?y1 ?x ?y2)
    (index ?x)
    (index++ ?y1 ?y2))
(<= (nextcell s ?x ?y1 ?x ?y2)
    (index ?x)
    (index++ ?y2 ?y1))
(<= (nextcell e ?x1 ?y ?x2 ?y)
    (index++ ?x1 ?x2)
    (index ?y))
(<= (nextcell w ?x1 ?y ?x2 ?y)
    (index++ ?x2 ?x1)
    (index ?y))
(<= (nextcell ne ?x1 ?y1 ?x2 ?y2)
    (index++ ?x1 ?x2)
    (index++ ?y1 ?y2))
(<= (nextcell nw ?x1 ?y1 ?x2 ?y2)
    (index++ ?x2 ?x1)
    (index++ ?y1 ?y2))
(<= (nextcell se ?x1 ?y1 ?x2 ?y2)
    (index++ ?x1 ?x2)
    (index++ ?y2 ?y1))
(<= (nextcell sw ?x1 ?y1 ?x2 ?y2)
    (index++ ?x2 ?x1)
    (index++ ?y2 ?y1))
(<= (openpiecestring ?player ?x0 ?y0 ?dir ?xf ?yf)
    (true (cell ?x0 ?y0 ?player))
    (nextcell ?dir ?x0 ?y0 ?xnext ?ynext)
    (openpiecestring ?player ?xnext ?ynext ?dir ?xf ?yf))
(<= (openpiecestring ?player ?x0 ?y0 ?dir ?xf ?yf)
    (true (cell ?x0 ?y0 ?player))
    (nextcell ?dir ?x0 ?y0 ?xf ?yf))
(<= (closedpiecestring ?player ?x0 ?y0 ?dir ?xf ?yf)
    (true (cell ?x0 ?y0 ?player))
    (nextcell ?dir ?x0 ?y0 ?xnext ?ynext)
    (closedpiecestring ?player ?xnext ?ynext ?dir ?xf ?yf))
(<= (closedpiecestring ?player ?x0 ?y0 ?dir ?xf ?yf)
    (true (cell ?x0 ?y0 ?player))
    (nextcell ?dir ?x0 ?y0 ?xf ?yf)
    (opponent ?player ?opponent)
    (true (cell ?xf ?yf ?opponent)))
(<= (playwillflip ?player ?xp ?yp ?opponent ?xo ?yo)
    (role ?player)
    (openpiecestring ?opponent ?xo ?yo ?dir ?xp ?yp)
    (opposite ?dir ?oppdir)
    (closedpiecestring ?opponent ?xo ?yo ?oppdir ?xany ?yany))
(<= (haslegalmoveat ?player ?xp ?yp)
    (cellopen ?xp ?yp)
    (opponent ?player ?opponent)
    (true (cell ?xo ?yo ?opponent))
    (playwillflip ?player ?xp ?yp ?opponent ?xo ?yo))
(<= (hasanylegalmove ?player)
    (haslegalmoveat ?player ?x ?y))
(<= (tally ?black ?red)
    (piececount 1 1 ?black ?red))
(<= (piececount ?x ?y ?blackcount++ ?redcount)
    (distinct ?y 8)
    (index++ ?y ?y++)
    (true (cell ?x ?y black))
    (piececount ?x ?y++ ?blackcount ?redcount)
    (++ ?blackcount ?blackcount++))
(<= (piececount ?x ?y ?blackcount ?redcount++)
    (distinct ?y 8)
    (index++ ?y ?y++)
    (true (cell ?x ?y red))
    (piececount ?x ?y++ ?blackcount ?redcount)
    (++ ?redcount ?redcount++))
(<= (piececount ?x ?y ?blackcount ?redcount)
    (distinct ?y 8)
    (index++ ?y ?y++)
    (cellopen ?x ?y)
    (piececount ?x ?y++ ?blackcount ?redcount))
(<= (piececount ?x 8 ?blackcount++ ?redcount)
    (distinct ?x 8)
    (index++ ?x ?x++)
    (true (cell ?x 8 black))
    (piececount ?x++ 1 ?blackcount ?redcount)
    (++ ?blackcount ?blackcount++))
(<= (piececount ?x 8 ?blackcount ?redcount++)
    (distinct ?x 8)
    (index++ ?x ?x++)
    (true (cell ?x 8 red))
    (piececount ?x++ 1 ?blackcount ?redcount)
    (++ ?redcount ?redcount++))
(<= (piececount ?x 8 ?blackcount ?redcount)
    (distinct ?x 8)
    (index++ ?x ?x++)
    (cellopen ?x 8)
    (piececount ?x++ 1 ?blackcount ?redcount))
(<= (piececount 8 8 1 0)
    (true (cell 8 8 black)))
(<= (piececount 8 8 0 1)
    (true (cell 8 8 red)))
(<= (piececount 8 8 0 0)
    (cellopen 8 8))
(<= (lessthan ?x ?y)
    (++ ?x ?x++)
    (lessthan ?x++ ?y))
(<= (lessthan ?x ?y)
    (++ ?x ?y))
(<= gameover
    (not (hasanylegalmove black))
    (not (hasanylegalmove red)))
(index 1)
(index 2)
(index 3)
(index 4)
(index 5)
(index 6)
(index 7)
(index 8)
(index++ 1 2)
(index++ 2 3)
(index++ 3 4)
(index++ 4 5)
(index++ 5 6)
(index++ 6 7)
(index++ 7 8)
(opponent red black)
(opponent black red)
(direction n)
(direction s)
(direction e)
(direction w)
(direction ne)
(direction nw)
(direction se)
(direction sw)
(opposite n s)
(opposite s n)
(opposite e w)
(opposite w e)
(opposite ne sw)
(opposite sw ne)
(opposite nw se)
(opposite se nw)
(int 0)
(int 1)
(int 2)
(int 3)
(int 4)
(int 5)
(int 6)
(int 7)
(int 8)
(int 9)
(int 10)
(int 11)
(int 12)
(int 13)
(int 14)
(int 15)
(int 16)
(int 17)
(int 18)
(int 19)
(int 20)
(int 21)
(int 22)
(int 23)
(int 24)
(int 25)
(int 26)
(int 27)
(int 28)
(int 29)
(int 30)
(int 31)
(int 32)
(int 33)
(int 34)
(int 35)
(int 36)
(int 37)
(int 38)
(int 39)
(int 40)
(int 41)
(int 42)
(int 43)
(int 44)
(int 45)
(int 46)
(int 47)
(int 48)
(int 49)
(int 50)
(int 51)
(int 52)
(int 53)
(int 54)
(int 55)
(int 56)
(int 57)
(int 58)
(int 59)
(int 60)
(int 61)
(int 62)
(int 63)
(int 64)
(++ 0 1)
(++ 1 2)
(++ 2 3)
(++ 3 4)
(++ 4 5)
(++ 5 6)
(++ 6 7)
(++ 7 8)
(++ 8 9)
(++ 9 10)
(++ 10 11)
(++ 11 12)
(++ 12 13)
(++ 13 14)
(++ 14 15)
(++ 15 16)
(++ 16 17)
(++ 17 18)
(++ 18 19)
(++ 19 20)
(++ 20 21)
(++ 21 22)
(++ 22 23)
(++ 23 24)
(++ 24 25)
(++ 25 26)
(++ 26 27)
(++ 27 28)
(++ 28 29)
(++ 29 30)
(++ 30 31)
(++ 31 32)
(++ 32 33)
(++ 33 34)
(++ 34 35)
(++ 35 36)
(++ 36 37)
(++ 37 38)
(++ 38 39)
(++ 39 40)
(++ 40 41)
(++ 41 42)
(++ 42 43)
(++ 43 44)
(++ 44 45)
(++ 45 46)
(++ 46 47)
(++ 47 48)
(++ 48 49)
(++ 49 50)
(++ 50 51)
(++ 51 52)
(++ 52 53)
(++ 53 54)
(++ 54 55)
(++ 55 56)
(++ 56 57)
(++ 57 58)
(++ 58 59)
(++ 59 60)
(++ 60 61)
(++ 61 62)
(++ 62 63)
(++ 63 64)

sees_XML(...) rules

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