Game tictactoe_3d_2player
name | tictactoe_3d_2player | |
---|---|---|
creator | admin | |
number of roles | 2 | |
stylesheet | tictactoe_3d/tictactoe_3d.xsl | |
GDL | v1 | |
enabled | ||
matches | show matches | |
statistics | show game statistics | |
description |
Game Description
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; 2-Player 3D-Tictactoe
;;; by Stephan Schiffel <stephan.schiffel@gmx.de>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Roles
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(role xplayer)
(role oplayer)
(sign xplayer x)
(sign oplayer o)
(nextplayer xplayer oplayer)
(nextplayer oplayer xplayer)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Initial State
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(<= (init (cell ?x ?y ?z b))
(coord ?x)
(coord ?y)
(coord ?z))
(init (control xplayer))
(coord 1)
(coord 2)
(coord 3)
(coord 4)
(succ 1 2)
(succ 2 3)
(succ 3 4)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Dynamic Components
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Cell
(<= (next (cell ?m ?n ?o ?s))
(true (cell ?m ?n ?o ?s))
(not (selected_cell ?m ?n ?o)))
(<= (next (cell ?m ?n ?o ?s))
(selected_cell ?m ?n ?o)
(true (control ?p))
(sign ?p ?s))
(<= (next (control ?p2))
(true (control ?p1))
(nextplayer ?p1 ?p2))
;;;;;;;;;;;;;;;;
(<= (selected_cell ?m ?n ?o)
(does ?p (select ?m ?n ?o)))
(<= selected_a_cell
(selected_cell ?m ?n ?o))
;;;;;;;;;;;;;;;;
(<= (line ?s)
(true (cell ?x1 ?y1 ?z1 ?s))
(direction ?xd ?yd ?zd)
(next_coord ?xd ?x1 ?x2)
(next_coord ?yd ?y1 ?y2)
(next_coord ?zd ?z1 ?z2)
(true (cell ?x2 ?y2 ?z2 ?s))
(next_coord ?xd ?x2 ?x3)
(next_coord ?yd ?y2 ?y3)
(next_coord ?zd ?z2 ?z3)
(true (cell ?x3 ?y3 ?z3 ?s))
(next_coord ?xd ?x3 ?x4)
(next_coord ?yd ?y3 ?y4)
(next_coord ?zd ?z3 ?z4)
(true (cell ?x4 ?y4 ?z4 ?s)))
; the 13 different directions for lines in a cube
(direction plus equal equal) ; x
(direction equal plus equal) ; y
(direction equal equal plus) ; z
(direction plus plus equal) ; xy
(direction plus minus equal) ; x-y
(direction plus equal plus) ; xz
(direction plus equal minus) ; x-z
(direction equal plus plus) ; yz
(direction equal plus minus) ; y-z
(direction plus plus plus) ; xyz
(direction plus plus minus) ; xy-z
(direction plus minus plus) ; x-yz
(direction plus minus minus) ; x-y-z
(<= (next_coord equal ?x ?x)
(coord ?x))
(<= (next_coord plus ?x1 ?x2)
(succ ?x1 ?x2))
(<= (next_coord minus ?x1 ?x2)
(succ ?x2 ?x1))
(<= open
(true (cell ?x ?y ?z b)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(<= (legal ?p noop)
(role ?p)
(not (true (control ?p))))
(<= (legal ?p (select ?x ?y ?z))
(true (control ?p))
(true (cell ?x ?y ?z b)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(<= (goal ?p 100)
(sign ?p ?s)
(line ?s))
(<= (goal ?p 50)
(role ?p)
(not (line x))
(not (line o)))
(<= (goal ?p 0)
(sign ?p ?s)
(sign ?p1 ?s1)
(distinct ?s ?s1)
(line ?s1))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(<= terminal
(sign ?p ?s)
(line ?s))
(<= terminal
(not open))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
sees_XML(...) rules
(<= (sees_xml random ?t) (true ?t))
(<= (sees_xml ?p ?t) (role ?p) (distinct ?p random) (true ?t))