You are not logged in. login register
Game kriegTTT_5x5
name kriegTTT_5x5
creator stephan
number of roles 2
stylesheet chess_like/chess_like_automatic.xsl
GDL v2
enabled
matches show matches
statistics show game statistics
description A GDL-II version of a Krieg-Tictactoe game. In this game, the board has a size of 5x5 cells, the players mark cells simultaneously, and the goal is to achieve a horizontal or vertical line of four pieces of the own color. The players do not see the opponent's move, but are informed if they tried to place a piece on an already occupied position (which might also be a position where the opponent tried to place a piece in this turn). This position may not be played on again, unless a valid move is performed.
GDL by Michael Thielscher (School of Computer Science and Engineering, The University of New South Wales)

Game Description

(role xplayer)
(role oplayer)

(init (cell 1 1 b))
(init (cell 1 2 b))
(init (cell 1 3 b))
(init (cell 1 4 b))
(init (cell 1 5 b))
(init (cell 2 1 b))
(init (cell 2 2 b))
(init (cell 2 3 b))
(init (cell 2 4 b))
(init (cell 2 5 b))
(init (cell 3 1 b))
(init (cell 3 2 b))
(init (cell 3 3 b))
(init (cell 3 4 b))
(init (cell 3 5 b))
(init (cell 4 1 b))
(init (cell 4 2 b))
(init (cell 4 3 b))
(init (cell 4 4 b))
(init (cell 4 5 b))
(init (cell 5 1 b))
(init (cell 5 2 b))
(init (cell 5 3 b))
(init (cell 5 4 b))
(init (cell 5 5 b))
(init (step 1))

(<= (legal ?p (mark ?m ?n))
   (role ?p)
   (true (cell ?m ?n ?c))
   (distinct ?c ?p)
   (not (true (tried ?p ?m ?n))))

(<= doublehit
   (does xplayer (mark ?m ?n))
   (does oplayer (mark ?m ?n)))

(<= (validmove ?p ?m ?n)
   (does ?p (mark ?m ?n))
   (true (cell ?m ?n b))
   (not doublehit))

(<= (marked ?m ?n)
   (does ?p (mark ?m ?n))
   (not doublehit))

(<= (next (cell ?m ?n ?p))
   (validmove ?p ?m ?n))

(<= (next (cell ?m ?n ?c))
   (true (cell ?m ?n ?c))
   (distinct ?c b))

(<= (next (cell ?m ?n b))
   (true (cell ?m ?n b))
   (not (marked ?m ?n)))

(<= (next (tried ?p ?m ?n))
   (does ?p (mark ?m ?n))
   (not (validmove ?p ?m ?n)))

(<= (next (tried ?p ?m1 ?n1))
   (true (tried ?p ?m1 ?n1))
   (does ?p (mark ?m2 ?n2))
   (not (validmove ?p ?m2 ?n2)))

(<= (next (step ?n))
   (true (step ?m))
   (succ ?m ?n))

(<= (sees ?p (yougotit ?m ?n))
   (validmove ?p ?m ?n))

(<= (sees ?p (mark ?m ?n))
   (does ?p (mark ?m ?n))
   (not (validmove ?p ?m ?n)))

(<= terminal
   (line xplayer))

(<= terminal
   (line oplayer))

(<= terminal
   (not open))

(<= terminal
   (true (step 30)))

(<= (line ?c)
   (true (cell ?m 1 ?c))
   (true (cell ?m 2 ?c))
   (true (cell ?m 3 ?c))
   (true (cell ?m 4 ?c)))

(<= (line ?c)
   (true (cell ?m 2 ?c))
   (true (cell ?m 3 ?c))
   (true (cell ?m 4 ?c))
   (true (cell ?m 5 ?c)))

(<= (line ?c)
   (true (cell 1 ?n ?c))
   (true (cell 2 ?n ?c))
   (true (cell 3 ?n ?c))
   (true (cell 4 ?n ?c)))

(<= (line ?c)
   (true (cell 2 ?n ?c))
   (true (cell 3 ?n ?c))
   (true (cell 4 ?n ?c))
   (true (cell 5 ?n ?c)))

(<= open
   (true (cell ?m1 ?n1 b))
   (not (true (tried xplayer ?m1 ?n1)))
   (true (cell ?m2 ?n2 b))
   (not (true (tried oplayer ?m2 ?n2))))

(<= (goal xplayer 100)
   (line xplayer))
  
(<= (goal xplayer 50)
   (not (line xplayer))
   (not (line oplayer)))
  
(<= (goal xplayer 0)
   (line oplayer))

(<= (goal oplayer 100)
   (line oplayer))
  
(<= (goal oplayer 50)
   (not (line xplayer))
   (not (line oplayer)))
  
(<= (goal oplayer 0)
   (line xplayer))

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

sees_XML(...) rules

(role_or_random random)
(<= (role_or_random ?p)
    (role ?p))

(<= (sees_xml ?p (cell ?x ?y x))
    (role_or_random ?p)
    (distinct ?p oplayer)
    (true (cell ?x ?y xplayer)))
(<= (sees_xml ?p (cell ?x ?y o))
    (role_or_random ?p)
    (distinct ?p xplayer)
    (true (cell ?x ?y oplayer)))
(<= (sees_xml ?p (cell ?x ?y b))
    (role_or_random ?p)
    (true (cell ?x ?y b)))
(<= (sees_xml ?p (step ?x))
    (role_or_random ?p)
    (true (step ?x)))
(<= (sees_xml ?p (tried ?p ?m ?n))
    (role_or_random ?p)
    (true (tried ?p ?m ?n)))