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

Game Description

; tictactoe but you do not win with a diagonal

  (role xplayer)
  (role oplayer)

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

  (<= (next (cell ?m ?n x))
      (does xplayer (mark ?m ?n))
      (true (cell ?m ?n b)))

  (<= (next (cell ?m ?n o))
      (does oplayer (mark ?m ?n))
      (true (cell ?m ?n b)))

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

  (<= (next (cell ?m ?n b))
      (does ?w (mark ?j ?k))
      (true (cell ?m ?n b))
      (or (distinct ?m ?j) (distinct ?n ?k)))

  (<= (next (control xplayer))
      (true (control oplayer)))

  (<= (next (control oplayer))
      (true (control xplayer)))

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

  (<= (line ?x) (row ?m ?x))
  (<= (line ?x) (column ?m ?x))

  (<= open
      (true (cell ?m ?n b)))

  (<= (legal ?w (mark ?x ?y))
      (true (cell ?x ?y b))
      (true (control ?w)))

  (<= (legal xplayer noop)
      (true (control oplayer)))

  (<= (legal oplayer noop)
      (true (control xplayer)))

  (<= (goal xplayer 100)
      (line x))

  (<= (goal xplayer 50)
	(not (line x))
  	(can_not_win oplayer))

  (<= (goal xplayer 0)
	(not (line x))
  	(not (can_not_win oplayer)))	
  (<= (goal xplayer 0)
      (line o))

  (<= (goal oplayer 100)
      (line o))

  (<= (goal oplayer 50)
	(not (line o))
      (can_not_win xplayer))
 (<= (goal oplayer 0)
     (not (line o))
     (not (can_not_win xplayer)))
  (<= (goal oplayer 0)
      (line x))

  (<= terminal
      (line x))

  (<= terminal
      (line o))

  (<= terminal
      (not open))

(<= (can_not_win xplayer)
    (true (cell 1 ?n o))
    (true (cell 2 ?m o))
    (true (cell 3 ?t o))
    (true (cell ?a 1 o))
    (true (cell ?b 2 o))
    (true (cell ?c 3 o)))
(<= (can_not_win oplayer)
    (true (cell 1 ?n x))
    (true (cell 2 ?m x))
    (true (cell 3 ?t x))
    (true (cell ?a 1 x))
    (true (cell ?b 2 x))
    (true (cell ?c 3 x)))

sees_XML(...) rules

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