Game toetictac
name | toetictac | |
---|---|---|
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Tictactoe Rereified
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(role xplayer)
(role oplayer)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(init (blank a))
(init (blank b))
(init (blank c))
(init (blank d))
(init (blank e))
(init (blank f))
(init (blank g))
(init (blank h))
(init (blank i))
(init (control xplayer))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(<= (next (ecks ?m))
(does xplayer (mark ?m))
(true (blank ?m)))
(<= (next (oh ?m))
(does oplayer (mark ?m))
(true (blank ?m)))
(<= (next (ecks ?m))
(true (ecks ?m)))
(<= (next (oh ?m))
(true (oh ?m)))
(<= (next (blank ?m))
(does ?w (mark ?n))
(true (blank ?m))
(distinct ?m ?n))
(<= (next (control xplayer))
(true (control oplayer)))
(<= (next (control oplayer))
(true (control xplayer)))
(line a b c)
(line a d g)
(line d e f)
(line b e h)
(line g h i)
(line c f i)
(line a e i)
(line c e g)
(<= xline
(line ?a ?b ?c)
(true (ecks ?a))
(true (ecks ?b))
(true (ecks ?c)))
(<= oline
(line ?a ?b ?c)
(true (oh ?a))
(true (oh ?b))
(true (oh ?c)))
(<= open
(true (blank ?m)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(<= (legal ?player (mark ?y))
(true (blank ?y))
(true (control ?player)))
(<= (legal oplayer noop)
(true (control xplayer)))
(<= (legal xplayer noop)
(true (control oplayer)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(<= (goal xplayer 100)
xline)
(<= (goal xplayer 50)
(not xline)
(not oline)
(not open))
(<= (goal xplayer 0)
oline)
(<= (goal oplayer 100)
oline)
(<= (goal oplayer 50)
(not xline)
(not oline)
(not open))
(<= (goal oplayer 0)
xline)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(<= terminal
xline)
(<= terminal
oline)
(<= terminal
(not open))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
sees_XML(...) rules
(<= (sees_xml random ?t) (sees_xml1 ?t))
(<= (sees_xml ?p ?t) (role ?p) (distinct ?p random) (sees_xml1 ?t))
; transform the cells such that the normal chess stylesheet understands them
(<= (sees_xml1 (cell ?x ?y b))
(true (blank ?loc))
(loc_to_coords ?loc ?x ?y))
(<= (sees_xml1 (cell ?x ?y x))
(true (ecks ?loc))
(loc_to_coords ?loc ?x ?y))
(<= (sees_xml1 (cell ?x ?y o))
(true (oh ?loc))
(loc_to_coords ?loc ?x ?y))
(<= (sees_xml1 (control ?p)) (true (control ?p)))
(loc_to_coords a 1 1)
(loc_to_coords b 1 2)
(loc_to_coords c 1 3)
(loc_to_coords d 2 1)
(loc_to_coords e 2 2)
(loc_to_coords f 2 3)
(loc_to_coords g 3 1)
(loc_to_coords h 3 2)
(loc_to_coords i 3 3)