Game ad_game_2x2

name | ad_game_2x2 | |
---|---|---|

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

```
(role blueplayer)
(role redplayer)
(init (cell 1 1 green))
(init (cell 1 2 green))
(init (cell 2 1 green))
(init (cell 2 2 green))
(totalboardsize 3)
(colour blue)
(colour green)
(colour red)
(succ 0 1)
(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)
(number 0)
(number 1)
(number 2)
(number 3)
(number 4)
(number 5)
(number 6)
(number 7)
(number 8)
(number 9)
(number 10)
(number 11)
(number 12)
(number 13)
(number 14)
(number 15)
(number 16)
(number 17)
(number 18)
(number 19)
(number 20)
(number 21)
(number 22)
(number 23)
(number 24)
(nextcell 1 1 1 2)
(nextcell 1 2 2 1)
(nextcell 2 1 2 2)
(nextcell 2 2 0 0)
(<= (add ?x 0 ?x)
(number ?x))
(<= (add ?x ?y ?z)
(succ ?x ?x1)
(succ ?y1 ?y)
(add ?x1 ?y1 ?z))
(<= (subtract ?x 0 ?x)
(number ?x))
(<= (subtract ?x ?y ?z)
(succ ?x1 ?x)
(succ ?y1 ?y)
(subtract ?x1 ?y1 ?z))
(<= (less ?x ?y)
(succ ?x ?y))
(<= (less ?x ?y)
(succ ?y1 ?y)
(less ?x ?y1))
(<= (le 0 ?x)
(number ?x))
(<= (le ?x 24)
(number ?x))
(<= (le ?x ?x)
(number ?x))
(<= (le ?x ?y)
(succ ?y1 ?y)
(le ?x ?y1))
(<= (abssubtract ?x ?y ?z)
(less ?x ?y)
(subtract ?y ?x ?z))
(<= (abssubtract ?x ?y ?z)
(le ?y ?x)
(subtract ?x ?y ?z))
(<= (legal ?w (placead ?r ?c))
(true (cell ?r ?c ?colour))
(role ?w))
(<= (dist ?r1 ?c1 ?r2 ?c2 ?d)
(abssubtract ?r1 ?r2 ?d1)
(abssubtract ?c1 ?c2 ?d2)
(add ?d1 ?d2 ?d))
(<= (invdist ?r1 ?c1 ?r2 ?c2 ?inv)
(dist ?r1 ?c1 ?r2 ?c2 ?d)
(totalboardsize ?size)
(subtract ?size ?d ?inv))
(<= (adpoints ?cellr ?cellc ?adr ?adc ?p)
(invdist ?cellr ?cellc ?adr ?adc ?p1)
(add ?p1 ?p1 ?p2)
(add ?p2 ?p2 ?p4)
(add ?p4 ?p1 ?p))
(<= (collectmouthpoints ?cellr ?cellc 0 0 ?colour 0)
(number ?cellr)
(number ?cellc)
(colour ?colour))
(<= (collectmouthpoints ?cellr ?cellc ?r ?c ?colour ?p)
(true (cell ?r ?c ?colour))
(invdist ?cellr ?cellc ?r ?c ?p1)
(nextcell ?r ?c ?nr ?nc)
(collectmouthpoints ?cellr ?cellc ?nr ?nc ?colour ?p2)
(add ?p1 ?p2 ?p))
(<= (collectmouthpoints ?cellr ?cellc ?r ?c ?colour ?p)
(not (true (cell ?r ?c ?colour)))
(nextcell ?r ?c ?nr ?nc)
(collectmouthpoints ?cellr ?cellc ?nr ?nc ?colour ?p))
(<= (mouthpoints ?cellr ?cellc ?colour ?p)
(collectmouthpoints ?cellr ?cellc 1 1 ?colour ?p))
(<= (cellpoints ?cellr ?cellc ?adr ?adc ?colour ?p)
(mouthpoints ?cellr ?cellc ?colour ?p1)
(adpoints ?cellr ?cellc ?adr ?adc ?p2)
(add ?p1 ?p2 ?p))
(<= (winner ?bluepoint ?redpoint blue)
(less ?bluepoint ?redpoint))
(<= (winner ?bluepoint ?redpoint red)
(less ?redpoint ?bluepoint))
(<= (winner ?bluepoint ?bluepoint green)
(number ?bluepoint))
(<= (cellinfluencescore ?cellr ?cellc ?winnercolour ?point)
(does blueplayer (placead ?blueadr ?blueadc))
(does redplayer (placead ?redadr ?redadc))
(cellpoints ?cellr ?cellc ?blueadr ?blueadc blue ?bluepoint)
(cellpoints ?cellr ?cellc ?redadr ?redadc red ?redpoint)
(winner ?bluepoint ?redpoint ?winnercolour)
(abssubtract ?bluepoint ?redpoint ?point))
(<= (takemax ?p1 ?p2 ?p1)
(less ?p2 ?p1))
(<= (takemax ?p1 ?p2 ?p2)
(le ?p1 ?p2))
(<= (bestscoreaccumulator 0 0 0))
(<= (bestscoreaccumulator ?r ?c ?p)
(true (cell ?r ?c green))
(nextcell ?r ?c ?nr ?nc)
(cellinfluencescore ?r ?c ?colour ?p1)
(bestscoreaccumulator ?nr ?nc ?p2)
(takemax ?p1 ?p2 ?p))
(<= (bestscoreaccumulator ?r ?c ?p)
(not (true (cell ?r ?c green)))
(nextcell ?r ?c ?nr ?nc)
(bestscoreaccumulator ?nr ?nc ?p))
(<= (bestscore ?point)
(bestscoreaccumulator 1 1 ?point))
(<= (takebest ?best ?cellscore ?col green)
(less ?cellscore ?best)
(colour ?col))
(<= (takebest ?best ?cellscore ?col ?col)
(le ?best ?cellscore)
(colour ?col))
(<= (next (cell ?r ?c blue))
(true (cell ?r ?c blue)))
(<= (next (cell ?r ?c red))
(true (cell ?r ?c red)))
(<= (next (cell ?r ?c ?colour))
(bestscore ?p2)
(true (cell ?r ?c green))
(cellinfluencescore ?r ?c ?c1 ?p1)
(takebest ?p2 ?p1 ?c1 ?colour))
(<= (next gameend)
(not open))
(<= (next gameend)
(bestscore 0))
(<= open
(true (cell ?r ?c green)))
(<= (update green ?b ?r ?b ?r)
(number ?b)
(number ?r))
(<= (update blue ?b ?r ?b1 ?r)
(number ?r)
(succ ?b ?b1))
(<= (update red ?b ?r ?b ?r1)
(number ?b)
(succ ?r ?r1))
(<= (countcellaccum 0 0 0 0))
(<= (countcellaccum ?r ?c ?bluecount ?redcount)
(getcolour ?r ?c ?colour)
(nextcell ?r ?c ?nc ?nr)
(countcellaccum ?nr ?nc ?b1 ?r1)
(update ?colour ?b1 ?r1 ?bluecount ?redcount))
(<= (countcell ?bluecount ?redcount)
(countcellaccum 1 1 ?bluecount ?redcount))
(<= (getcolour ?r ?c green)
(true (cell ?r ?c green)))
(<= (getcolour ?r ?c red)
(true (cell ?r ?c red)))
(<= (getcolour ?r ?c blue)
(true (cell ?r ?c blue)))
(<= (goal ?player ?score)
(countcell ?bluecount ?redcount)
(goal2 ?bluecount ?redcount ?player ?score))
(<= (goal2 ?bluecount ?redcount blueplayer 100)
(less ?redcount ?bluecount))
(<= (goal2 ?bluecount ?redcount redplayer ?partial)
(less ?redcount ?bluecount)
(add ?redcount ?redcount ?p2)
(add ?p2 ?p2 ?p4)
(add ?p4 ?redcount ?partial))
(<= (goal2 ?bluecount ?redcount redplayer 100)
(less ?bluecount ?redcount))
(<= (goal2 ?bluecount ?redcount blueplayer ?partial)
(less ?bluecount ?redcount)
(add ?bluecount ?bluecount ?p2)
(add ?p2 ?p2 ?p4)
(add ?p4 ?bluecount ?partial))
(<= (goal2 ?count ?count ?player 50)
(number ?count)
(role ?player))
(<= terminal
(true gameend))
```

## sees_XML(...) rules

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