You are not logged in. login register
Game DotsAndBoxesExperimental
name DotsAndBoxesExperimental
creator baum
number of roles 2
stylesheet generic/generic.xsl
GDL v1
enabled
matches show matches
statistics show game statistics
description

Game Description

;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;; Dots and Boxes ;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;; Roles ;;;;;;;;;;;

(role misterx)
(role mistery)

;;;;;;;; Initials ;;;;;;;;

(init (cell 2 1 b))
(init (cell 4 1 b))

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

(init (cell 2 3 b))
(init (cell 4 3 b))

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

(init (cell 2 5 b))
(init (cell 4 5 b))

(init (points misterx 0))
(init (points mistery 0))

(init (control misterx))
(init (round 0))

;;;;;;;;;;;;;;;;;;;;;;;;;;;

(<= (next (cell ?x ?y f))
	(does ?r (mark ?x ?y))
	(true (cell ?x ?y b)))
	
(<= (next (cell ?x ?y f))
	(true (cell ?x ?y f)))
	
(<= (next (cell ?x ?y b))
	(does ?r (mark ?i ?j))
	(true (cell ?x ?y b))
	(or (distinct ?x ?i) (distinct ?y ?j)))

(<= (justBoxed (role ?r))
	(true (points ?r 0))
	(or (nextt (points ?r 1)) (nextt (points ?r 2))))
(<= (justBoxed (role ?r))
	(true (points ?r 1))
	(or (nextt (points ?r 2)) (nextt (points ?r 3))))
(<= (justBoxed (role ?r))
	(true (points ?r 2))
	(or (nextt (points ?r 3)) (nextt (points ?r 4))))
(<= (justBoxed (role ?r))
	(true (points ?r 3))
	(nextt (points ?r 4)))
	
(<= (next (points ?r 1))
	(true (points ?r 0))
	(control ?r)
	(or (newBox 1 1) (newBox 1 2) (newBox 2 1) (newBox 2 2)))
(<= (next (points ?r 2))
	(true (points ?r 1))
	(control ?r)
	(or (newBox 1 1) (newBox 1 2) (newBox 2 1) (newBox 2 2)))
(<= (next (points ?r 3))
	(true (points ?r 2))
	(control ?r)
	(or (newBox 1 1) (newBox 1 2) (newBox 2 1) (newBox 2 2)))
(<= (next (points ?r 4))
	(true (points ?r 3))
	(or (newBox 1 1) (newBox 1 2) (newBox 2 1) (newBox 2 2)))
	
(<= (next (points ?r ?n))
	(true (points ?r ?n))
	(control ?r)
	(not (newBox 1 1))
	(not (newBox 1 2))
	(not (newBox 2 1))
	(not (newBox 2 2)))

	
(<= (newBox ?x ?y)
	(not (true (box ?x ?y)))
	(nextt (box ?x ?y)))
	
(<= (nextt (box ?x ?y))
	(true (box ?x ?y)))
	
(<= (nextt (box 1 1))
	(oneLeft 1 1 (mark 2 1))
	(does ?r (mark 2 1)))
(<= (nextt (box 1 1))
	(oneLeft 1 1 (mark 1 2))
	(does ?r (mark 1 2)))
(<= (nextt (box 1 1))
	(oneLeft 1 1 (mark 3 2))
	(does ?r (mark 3 2)))
(<= (nextt (box 1 1))
	(oneLeft 1 1 (mark 2 3))
	(does ?r (mark 2 3)))
(<= (nextt (points ?r 1))
	(true (points ?r 0))
	(control ?r)
	(or (newBox 1 1) (newBox 1 2) (newBox 2 1) (newBox 2 2)))
(<= (nextt (points ?r 2))
	(true (points ?r 1))
	(control ?r)
	(or (newBox 1 1) (newBox 1 2) (newBox 2 1) (newBox 2 2)))
(<= (nextt (points ?r 3))
	(true (points ?r 2))
	(control ?r)
	(or (newBox 1 1) (newBox 1 2) (newBox 2 1) (newBox 2 2)))
(<= (nextt (points ?r 4))
	(true (points ?r 3))
	(or (newBox 1 1) (newBox 1 2) (newBox 2 1) (newBox 2 2)))	
(<= (nextt (points ?r ?n))
	(true (points ?r ?n))
	(control ?r)
	(not (newBox 1 1))
	(not (newBox 1 2))
	(not (newBox 2 1))
	(not (newBox 2 2)))
(<= (nextt (box 1 2))
	(oneLeft 1 2 (mark 2 2))
	(does ?r (mark 2 2)))
(<= (nextt (box 1 2))
	(oneLeft 1 2 (mark 1 3))
	(does ?r (mark 1 3)))
(<= (nextt (box 1 2))
	(oneLeft 1 2 (mark 3 3))
	(does ?r (mark 3 3)))
(<= (nextt (box 1 2))
	(oneLeft 1 2 (mark 2 4))
	(does ?r (mark 2 4)))
(<= (nextt (box 2 1))
	(oneLeft 2 1 (mark 3 1))
	(does ?r (mark 3 1)))
(<= (nextt (box 2 1))
	(oneLeft 2 1 (mark 2 2))
	(does ?r (mark 2 2)))
(<= (nextt (box 2 1))
	(oneLeft 2 1 (mark 4 2))
	(does ?r (mark 4 2)))
(<= (nextt (box 2 1))
	(oneLeft 2 1 (mark 3 3))
	(does ?r (mark 3 3)))
(<= (nextt (box 2 2))
	(oneLeft 2 2 (mark 3 2))
	(does ?r (mark 3 2)))
(<= (nextt (box 2 2))
	(oneLeft 2 2 (mark 2 3))
	(does ?r (mark 2 3)))
(<= (nextt (box 2 2))
	(oneLeft 2 2 (mark 4 3))
	(does ?r (mark 4 3)))
(<= (nextt (box 2 2))
	(oneLeft 2 2 (mark 3 4))
	(does ?r (mark 3 4)))



(<= (next (box ?x ?y))
	(true (box ?x ?y)))
	
(<= (next (box 1 1))
	(oneLeft 1 1 (mark 2 1))
	(does ?r (mark 2 1)))
(<= (next (box 1 1))
	(oneLeft 1 1 (mark 1 2))
	(does ?r (mark 1 2)))
(<= (next (box 1 1))
	(oneLeft 1 1 (mark 3 2))
	(does ?r (mark 3 2)))
(<= (next (box 1 1))
	(oneLeft 1 1 (mark 2 3))
	(does ?r (mark 2 3)))
(<= (oneLeft 1 1 (mark 2 1))
	(true (cell 2 1 b))
	(true (cell 1 2 f))
	(true (cell 3 2 f))
	(true (cell 2 3 f)))
(<= (oneLeft 1 1 (mark 1 2))
	(true (cell 2 1 f))
	(true (cell 1 2 b))
	(true (cell 3 2 f))
	(true (cell 2 3 f)))
(<= (oneLeft 1 1 (mark 3 2))
	(true (cell 2 1 f))
	(true (cell 1 2 f))
	(true (cell 3 2 b))
	(true (cell 2 3 f)))
(<= (oneLeft 1 1 (mark 2 3))
	(true (cell 2 1 f))
	(true (cell 1 2 f))
	(true (cell 3 2 f))
	(true (cell 2 3 b)))
	
(<= (next (box 1 2))
	(oneLeft 1 2 (mark 2 2))
	(does ?r (mark 2 2)))
(<= (next (box 1 2))
	(oneLeft 1 2 (mark 1 3))
	(does ?r (mark 1 3)))
(<= (next (box 1 2))
	(oneLeft 1 2 (mark 3 3))
	(does ?r (mark 3 3)))
(<= (next (box 1 2))
	(oneLeft 1 2 (mark 2 4))
	(does ?r (mark 2 4)))
(<= (oneLeft 1 2 (mark 2 2))
	(true (cell 2 2 b))
	(true (cell 1 3 f))
	(true (cell 3 3 f))
	(true (cell 2 4 f)))
(<= (oneLeft 1 2 (mark 1 3))
	(true (cell 2 2 f))
	(true (cell 1 3 b))
	(true (cell 3 3 f))
	(true (cell 2 4 f)))
(<= (oneLeft 1 2 (mark 3 3))
	(true (cell 2 2 f))
	(true (cell 1 3 f))
	(true (cell 3 3 b))
	(true (cell 2 4 f)))
(<= (oneLeft 1 2 (mark 2 4))
	(true (cell 2 2 f))
	(true (cell 1 3 f))
	(true (cell 3 3 f))
	(true (cell 2 4 b)))
	
(<= (next (box 2 1))
	(oneLeft 2 1 (mark 3 1))
	(does ?r (mark 3 1)))
(<= (next (box 2 1))
	(oneLeft 2 1 (mark 2 2))
	(does ?r (mark 2 2)))
(<= (next (box 2 1))
	(oneLeft 2 1 (mark 4 2))
	(does ?r (mark 4 2)))
(<= (next (box 2 1))
	(oneLeft 2 1 (mark 3 3))
	(does ?r (mark 3 3)))
(<= (oneLeft 2 1 (mark 3 1))
	(true (cell 3 1 b))
	(true (cell 2 2 f))
	(true (cell 4 2 f))
	(true (cell 3 3 f)))
(<= (oneLeft 2 1 (mark 2 2))
	(true (cell 3 1 f))
	(true (cell 2 2 b))
	(true (cell 4 2 f))
	(true (cell 3 3 f)))
(<= (oneLeft 2 1 (mark 4 2))
	(true (cell 3 1 f))
	(true (cell 2 2 f))
	(true (cell 4 2 b))
	(true (cell 3 3 f)))
(<= (oneLeft 2 1 (mark 3 3))
	(true (cell 3 1 f))
	(true (cell 2 2 f))
	(true (cell 4 2 f))
	(true (cell 3 3 b)))
	
(<= (next (box 2 2))
	(oneLeft 2 2 (mark 3 2))
	(does ?r (mark 3 2)))
(<= (next (box 2 2))
	(oneLeft 2 2 (mark 2 3))
	(does ?r (mark 2 3)))
(<= (next (box 2 2))
	(oneLeft 2 2 (mark 4 3))
	(does ?r (mark 4 3)))
(<= (next (box 2 2))
	(oneLeft 2 2 (mark 3 4))
	(does ?r (mark 3 4)))
(<= (oneLeft 2 2 (mark 3 2))
	(true (cell 3 2 b))
	(true (cell 2 3 f))
	(true (cell 4 3 f))
	(true (cell 3 4 f)))
(<= (oneLeft 2 2 (mark 2 3))
	(true (cell 3 2 f))
	(true (cell 2 3 b))
	(true (cell 4 3 f))
	(true (cell 3 4 f)))
(<= (oneLeft 2 2 (mark 4 3))
	(true (cell 3 2 f))
	(true (cell 2 3 f))
	(true (cell 4 3 b))
	(true (cell 3 4 f)))
(<= (oneLeft 2 2 (mark 3 4))
	(true (cell 3 2 f))
	(true (cell 2 3 f))
	(true (cell 4 3 f))
	(true (cell 3 4 b)))
	
(<= (box 1 1)
	(true (cell 2 1 f))
	(true (cell 1 2 f))
	(true (cell 3 2 f))
	(true (cell 2 3 f)))
(<= (box 1 2)
	(true (cell 2 2 f))
	(true (cell 1 3 f))
	(true (cell 3 3 f))
	(true (cell 2 4 f)))
(<= (box 2 1)
	(true (cell 3 1 f))
	(true (cell 2 2 f))
	(true (cell 4 2 f))
	(true (cell 3 3 f)))
(<= (box 2 2)
	(true (cell 3 2 f))
	(true (cell 2 3 f))
	(true (cell 4 3 f))
	(true (cell 3 4 f)))

(<= (next (control misterx))
	(true (control mistery))
	(not (justBoxed mistery)))
	
(<= (next (control mistery))
	(true (control misterx))
	(not (justBoxed misterx)))
	
(<= (next (round 1))
	(true (round 0)))
(<= (next (round 2))
	(true (round 1)))
(<= (next (round 3))
	(true (round 2)))
(<= (next (round 4))
	(true (round 3)))
(<= (next (round 5))
	(true (round 4)))
(<= (next (round 6))
	(true (round 5)))
(<= (next (round 7))
	(true (round 6)))
(<= (next (round 8))
	(true (round 7)))
(<= (next (round 9))
	(true (round 8)))
(<= (next (round 10))
	(true (round 9)))
(<= (next (round 11))
	(true (round 10)))
(<= (next (round 12))
	(true (round 11)))

;;;;;;;;; Legal Moves ;;;;;

(<= (legal ?r (mark ?x ?y))
	(true (cell ?x ?y b))
	(true (control ?r)))
	
(<= (legal misterx noop)
	(true (control mistery)))
	
(<= (legal mistery noop)
	(true (control misterx)))

;;;;;;;;; Goals ;;;;;;;;;;;

(<= (goal (role ?r) 100)
	(points ?r 4))
	
(<= (goal (role ?r) 75)
	(points ?r 3))
	
(<= (goal (role ?r) 50)
	(points ?r 2))
	
(<= (goal (role ?r) 25)
	(points ?r 1))
	
(<= (goal (role ?r) 0)
	(points ?r 0))

;;;;;;;; Terminal ;;;;;;;;;

(<= terminal
	(true (round 12)))
	
;;;;;;;;;;;;;;;;;;;;;;;;;;;

sees_XML(...) rules

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