You are not logged in. login register
Game minichess
name minichess
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

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Minichess
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(role white)
(role black)

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

(init (cell a 1 b))
(init (cell a 2 b))
(init (cell a 3 b))
(init (cell a 4 bk))
(init (cell b 1 b))
(init (cell b 2 b))
(init (cell b 3 b))
(init (cell b 4 b))
(init (cell c 1 wk))
(init (cell c 2 b))
(init (cell c 3 b))
(init (cell c 4 b))
(init (cell d 1 wr))
(init (cell d 2 b))
(init (cell d 3 b))
(init (cell d 4 b))
(init (control white))
(init (step 1))

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

(<= (next (cell ?x ?y ?p))
    (does ?player (move ?p ?u ?v ?x ?y)))
    
(<= (next (cell ?u ?v b))
    (does ?player (move ?p ?u ?v ?x ?y)))
    
(<= (next (cell ?w ?z b))
    (does ?player (move ?p ?u ?v ?x ?y))
    (true (cell ?w ?z b))
    (or (distinct ?w ?x) (distinct ?z ?y)))
    
(<= (next (cell ?w ?z ?q))
    (does ?player (move ?p ?u ?v ?x ?y))
    (true (cell ?w ?z ?q))
    (distinct ?p ?q)
    (distinct ?q b))
    
(<= (next (control white))
    (true (control black)))
    
(<= (next (control black))
    (true (control white)))
    
(<= (next (step ?y))
    (true (step ?x))
    (succ ?x ?y))
    
(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)

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

(<= (legal white (move wk ?u ?v ?x ?y))
    (true (control white))
    (true (cell ?u ?v wk))
    (kingmove ?u ?v ?x ?y)
    (true (cell ?x ?y b))
    (not (restricted ?x ?y)))
    
(<= (legal white (move wr ?u ?v ?x ?y))
    (true (control white))
    (true (cell ?u ?v wr))
    (rookmove ?u ?v ?x ?y)
    (true (cell ?x ?y b))
    (not (restricted ?x ?y)))
    
(<= (legal white noop)
    (true (control black)))
    
(<= (legal black (move bk ?u ?v ?x ?y))
    (true (control black))
    (true (cell ?u ?v bk))
    (kingmove ?u ?v ?x ?y)
    (true (cell ?x ?y b))
    (not (attacked bk ?x ?y))
    (not (guarded ?x ?y)))
    
(<= (legal black noop)
    (true (control white)))
    
  (<= (kingmove ?u ?v ?u ?y)
      (or (adjacent ?v ?y) (adjacent ?y ?v))
      (coordinate ?u))

  (<= (kingmove ?u ?v ?x ?v)
      (or (nextcolumn ?u ?x) (nextcolumn ?x ?u))
      (coordinate ?v))

  (<= (kingmove ?u ?v ?x ?y)
      (or (nextcolumn ?u ?x) (nextcolumn ?x ?u))
      (or (adjacent ?v ?y) (adjacent ?y ?v)))
    
(<= (rookmove ?u ?v ?u ?y)
    (clearcolumn wr ?u ?v ?y))
    
(<= (rookmove ?u ?v ?u ?y)
    (clearcolumn wr ?u ?y ?v))
    
(<= (rookmove ?u ?v ?x ?v)
    (clearrow wr ?u ?x ?v))
    
(<= (rookmove ?u ?v ?x ?v)
    (clearrow wr ?x ?u ?v))
    
(<= checkmate
    check
    stuck)
    
(<= check
    (true (cell ?u ?v bk))
    (attacked bk ?u ?v))
    
(<= stuck
    (not canmove))
    
(<= canmove
    (true (cell ?u ?v bk))
    (true (cell ?x ?y b))
    (kingmove ?u ?v ?x ?y)
    (not (attacked bk ?x ?y))
    (not (guarded ?x ?y)))
    
(<= (restricted ?x ?y)
    (true (cell ?u ?v bk))
    (kingmove ?u ?v ?x ?y))
    
(<= (guarded ?x ?y)
    (true (cell ?u ?v wk))
    (kingmove ?u ?v ?x ?y))
    
(<= (attacked ?p ?u ?w)
    (true (cell ?u ?v wr))
    (clearcolumn ?p ?u ?v ?w))
    
(<= (attacked ?p ?u ?v)
    (true (cell ?u ?w wr))
    (clearcolumn ?p ?u ?v ?w))
    
(<= (attacked ?p ?u ?v)
    (true (cell ?x ?v wr))
    (clearrow ?p ?u ?x ?v))
    
(<= (attacked ?p ?u ?v)
    (true (cell ?x ?v wr))
    (clearrow ?p ?x ?u ?v))
    
(<= (clearcolumn ?p ?x ?y1 ?y2)
    (adjacent ?y1 ?y2)
    (coordinate ?x)
    (piece ?p))
    
(<= (clearcolumn ?p ?x ?y1 ?y3)
    (adjacent ?y1 ?y2)
    (adjacent ?y2 ?y3)
    (or (true (cell ?x ?y2 b)) (true (cell ?x ?y2 ?p)))
    (piece ?p))
    
(<= (clearcolumn ?p ?x ?y1 ?y4)
    (adjacent ?y1 ?y2)
    (adjacent ?y2 ?y3)
    (adjacent ?y3 ?y4)
    (or (true (cell ?x ?y2 b)) (true (cell ?x ?y2 ?p)))
    (or (true (cell ?x ?y3 b)) (true (cell ?x ?y3 ?p)))
    (piece ?p))
    
(<= (clearrow ?p ?x1 ?x2 ?y)
    (nextcolumn ?x1 ?x2)
    (coordinate ?y)
    (piece ?p))
    
(<= (clearrow ?p ?x1 ?x3 ?y)
    (nextcolumn ?x1 ?x2)
    (nextcolumn ?x2 ?x3)
    (or (true (cell ?x2 ?y b)) (true (cell ?x2 ?y ?p)))
    (piece ?p))
    
(<= (clearrow ?p ?x1 ?x4 ?y)
    (nextcolumn ?x1 ?x2)
    (nextcolumn ?x2 ?x3)
    (nextcolumn ?x3 ?x4)
    (or (true (cell ?x2 ?y b)) (true (cell ?x2 ?y ?p)))
    (or (true (cell ?x3 ?y b)) (true (cell ?x3 ?y ?p)))
    (piece ?p))
    
(adjacent 1 2)
(adjacent 2 3)
(adjacent 3 4)
(nextcolumn a b)
(nextcolumn b c)
(nextcolumn c d)

; BOARD COORDINATES

(coordinate 1)
(coordinate 2)
(coordinate 3)
(coordinate 4)
(coordinate a)
(coordinate b)
(coordinate c)
(coordinate d)

(piece wk)
(piece bk)
(piece wr)

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

(<= (goal white 100)
    checkmate)
(<= (goal white 0)
    (not checkmate))
(<= (goal black 100)
    (not checkmate))
(<= (goal black 0)
    checkmate)
(<= terminal
    (true (step 10)))
(<= terminal
    stuck)


sees_XML(...) rules

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