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

Game Description

; brain teaser
(role player)

; Initial state
(init (step 0))
(init (cell 1 1 yellow))
(init (cell 1 2 yellow))
(init (cell 1 3 yellow))

(init (cell 2 1 yellow))
(init (cell 2 2 yellow))
(init (cell 2 3 yellow))

(init (cell 3 1 yellow))
(init (cell 3 2 yellow))
(init (cell 3 3 yellow))

; Legal moves
(<= (legal player (select ?x ?y))
    (true (cell ?x ?y ?color))
    (not (all_orange numbers)))

(<= (legal player celebrate)
    (all_orange numbers))

; Transition rules
(<= (next (cell a a yellow))
    (all_orange numbers))
(<= (next (cell a b yellow))
    (all_orange numbers))
(<= (next (cell a c yellow))
    (all_orange numbers))
(<= (next (cell a d yellow))
    (all_orange numbers))

(<= (next (cell b a yellow))
    (all_orange numbers))
(<= (next (cell b b yellow))
    (all_orange numbers))
(<= (next (cell b c yellow))
    (all_orange numbers))
(<= (next (cell b d yellow))
    (all_orange numbers))

(<= (next (cell c a yellow))
    (all_orange numbers))
(<= (next (cell c b yellow))
    (all_orange numbers))
(<= (next (cell c c yellow))
    (all_orange numbers))
(<= (next (cell c d yellow))
    (all_orange numbers))

(<= (next (cell d a yellow))
    (all_orange numbers))
(<= (next (cell d b yellow))
    (all_orange numbers))
(<= (next (cell d c yellow))
    (all_orange numbers))
(<= (next (cell d d yellow))
    (all_orange numbers))

(<= (next (step ?new_step))
    (true (step ?old_step))
    (succ ?old_step ?new_step))
(<= (next (cell ?x ?y ?color))
    (true (cell ?x ?y ?color))
    (not (all_orange numbers))
    (not (changes ?x ?y)))
(<= (next (cell ?x ?y orange))
    (true (cell ?x ?y yellow))
    (changes ?x ?y))
(<= (next (cell ?x ?y yellow))
    (true (cell ?x ?y orange))
    (changes ?x ?y))
(<= (changes ?x ?y)
    (does player (select ?adj ?y))
    (adjacent ?x ?adj))
(<= (changes ?x ?y)
    (does player (select ?x ?adj))
    (adjacent ?y ?adj))
(<= (changes ?x ?y)
    (does player (select ?x ?y)))

; Termination conditions
(<= terminal
    (true (step 15)))
(<= terminal
    (all_orange letters))

; Payoffs
(<= (goal player 100)
    (true (step 10))
    (all_orange letters))
(<= (goal player 80)
    (not (true (step 10)))
    (all_orange letters))
(<= (goal player 40)
    (true (cell a a orange))
    (not (all_orange letters)))
(<= (goal player 40)
    (true (cell a a yellow)))
(<= (goal player 0)
    (not (true (cell a a yellow)))
    (not (true (cell a a orange))))

(<= (all_orange numbers)
  (true (cell 1 1 orange))
  (true (cell 1 2 orange))
  (true (cell 1 3 orange))
  (true (cell 2 1 orange))
  (true (cell 2 2 orange))
  (true (cell 2 3 orange))
  (true (cell 3 1 orange))
  (true (cell 3 2 orange))
  (true (cell 3 3 orange)))
  
(<= (all_orange letters)
  (true (cell a a orange))
  (true (cell a b orange))
  (true (cell a c orange))
  (true (cell a d orange))
  (true (cell b a orange))
  (true (cell b b orange))
  (true (cell b c orange))
  (true (cell b d orange))
  (true (cell c a orange))
  (true (cell c b orange))
  (true (cell c c orange))
  (true (cell c d orange))
  (true (cell d a orange))
  (true (cell d b orange))
  (true (cell d c orange))
  (true (cell d d orange)))
  
(succ 0 1)
(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)

(adjacent 1 2)
(adjacent 2 1)
(adjacent 2 3)
(adjacent 3 2)

(adjacent a b)
(adjacent b a)
(adjacent b c)
(adjacent c b)
(adjacent c d)
(adjacent d c)

sees_XML(...) rules

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