You are not logged in. login register
Game cube_2x2x2
name cube_2x2x2
creator stephan
number of roles 1
stylesheet generic/generic.xsl
GDL v1
enabled
matches show matches
statistics show game statistics
description small version of Rubik's Cube
GDL by: Arne König, Christian Drescher, Max Ostrowski and Torsten Grote
http://deepthought.23inch.de/

Game Description

(role player)
(init (face a 0 0 1 white))
(init (face a 0 1 1 green))
(init (face a 1 0 1 blue))
(init (face a 1 1 1 blue))
(init (face b 0 1 0 orange))
(init (face b 0 1 1 yellow))
(init (face b 1 1 0 white))
(init (face b 1 1 1 white))
(init (face c 1 0 0 blue))
(init (face c 1 0 1 orange))
(init (face c 1 1 0 orange))
(init (face c 1 1 1 orange))
(init (face d 0 0 0 red))
(init (face d 0 1 0 yellow))
(init (face d 1 0 0 yellow))
(init (face d 1 1 0 green))
(init (face e 0 0 0 white))
(init (face e 0 0 1 blue))
(init (face e 1 0 0 red))
(init (face e 1 0 1 yellow))
(init (face f 0 0 0 green))
(init (face f 0 0 1 red))
(init (face f 0 1 0 green))
(init (face f 0 1 1 red))
(init (step 1))

(npos cw 0 0 0 1)
(npos cw 0 1 1 1)
(npos cw 1 0 0 0)
(npos cw 1 1 1 0)
(<= (npos ac ?x1 ?y1 ?x2 ?y2)
    (npos cw ?x2 ?y2 ?x1 ?y1))

(nside cw x a b)
(nside cw x b d)
(nside cw x d e)
(nside cw x e a)
(nside cw x c c)
(nside cw y a f)
(nside cw y f d)
(nside cw y d c)
(nside cw y c a)
(nside cw y b b)
(nside cw z a a)
(nside cw z b c)
(nside cw z c e)
(nside cw z e f)
(nside cw z f b)
(<= (nside ac ?axis ?s1 ?s2)
    (nside cw ?axis ?s2 ?s1))

(<= (next (face ?s 0 ?y ?z ?color))
    (true (face ?s 0 ?y ?z ?color))
    (does player (turn x ?dir)))
(<= (next (face ?s ?x 0 ?z ?color))
    (true (face ?s ?x 0 ?z ?color))
    (does player (turn y ?dir)))
(<= (next (face ?s ?x ?y 0 ?color))
    (true (face ?s ?x ?y 0 ?color))
    (does player (turn z ?dir)))

(<= (next (face ?s2 1 ?y2 ?z2 ?color))
    (true (face ?s1 1 ?y1 ?z1 ?color))
    (does player (turn x ?dir))
    (npos ?dir ?y1 ?z1 ?y2 ?z2)
    (nside ?dir x ?s1 ?s2))
(<= (next (face ?s2 ?x2 1 ?z2 ?color))
    (true (face ?s1 ?x1 1 ?z1 ?color))
    (does player (turn y ?dir))
    (npos ?dir ?x2 ?z2 ?x1 ?z1)
    (nside ?dir y ?s1 ?s2))
(<= (next (face ?s2 ?x2 ?y2 1 ?color))
    (true (face ?s1 ?x1 ?y1 1 ?color))
    (does player (turn z ?dir))
    (npos ?dir ?x1 ?y1 ?x2 ?y2)
    (nside ?dir z ?s1 ?s2))

(<= (next (step ?y))
    (true (step ?x))
    (succ ?x ?y))

(legal player (turn x cw))
(legal player (turn x ac))
(legal player (turn y cw))
(legal player (turn y ac))
(legal player (turn z cw))
(legal player (turn z ac))

(<= solved
    (true (face a 0 0 1 orange)) 
    (true (face a 0 1 1 orange)) 
    (true (face a 1 0 1 orange)) 
    (true (face a 1 1 1 orange)) 
    (true (face b 0 1 0 yellow))
    (true (face b 0 1 1 yellow))
    (true (face b 1 1 0 yellow))
    (true (face b 1 1 1 yellow))
    (true (face c 1 0 0 blue)) 
    (true (face c 1 0 1 blue)) 
    (true (face c 1 1 0 blue)) 
    (true (face c 1 1 1 blue)) 
    (true (face d 0 0 0 red)) 
    (true (face d 0 1 0 red)) 
    (true (face d 1 0 0 red)) 
    (true (face d 1 1 0 red)) 
    (true (face e 0 0 0 white))
    (true (face e 0 0 1 white))
    (true (face e 1 0 0 white))
    (true (face e 1 0 1 white))
    (true (face f 0 0 0 green)) 
    (true (face f 0 0 1 green)) 
    (true (face f 0 1 0 green)) 
    (true (face f 0 1 1 green)))

(<= (goal player 100) solved)
(<= (goal player 0)
    (not solved))

(<= terminal solved)  
(<= terminal (true (step 13)))

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

sees_XML(...) rules

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