Zillions

Zillions of Games is a commercial general game playing system developed by Jeff Mallett and Mark Lefler in 1998. The game rules are specified with S-expressions in the Zillions rule language. It was designed to handle mostly abstract strategy board games or puzzles.

After parsing the rules of the game, the system’s artificial intelligence can automatically play one or more players. It treats puzzles as solitaire games and its AI can be used to solve them.

Home http://www.zillions-of-games.com/
Wiki https://en.wikipedia.org/wiki/Zillions_of_Games
Chess variants https://www.chessvariants.com/programs.dir/zillions/

The game is written in C++ for Windows desktop (GDI) exclusively. Source code has not been released.

Here is Zillions code for Tic-Tac-Toe.

(game
  (title "Tic-Tac-Toe")
  (description "The game is played on a 3 by 3 grid between players X and O.
    Player X goes first. Each player alternately drops a man in an empty square.
    The game is won if either side gets three in a row, horizontally,
    vertically, or diagonally. Otherwise it's a draw.")
  (history "Tic-Tac-Toe is an old game and is often played when there are
    no moveable pieces available, by drawing or carving marks.
    It is played all over the world under various names, such as 'Noughts and Crosses' in
    England.")
  (strategy "With perfect play, Tic-Tac-Toe is a draw. First player has the 
    advantage, provided the first move is centre or corner. Most games are won
    by leaving two open twos that cannot both be blocked.")
  (players X O)
  (turn-order X O)
  (board
    (image "TTTbrd.png")
    (grid
      (start-rectangle 16 16 112 112) ; top-left position
      (dimensions
        ("A-/B-/C-" (0 112)) ; rows
        ("1/2/3" (112 0))) ; columns
      (directions (n -1 0) (e 0 1) (nw -1 -1) (ne -1 1))
    )
  )
  (piece
    (name man)
    (help "Man: drops on any empty space")
    (image X "TTTX.png"
           O "TTTO.png")
    (drops ((verify empty?) add))
  )
  (board-setup
    (X (man off 5))
    (O (man off 5))
  )

  (draw-condition (X O) stalemated)
  (win-condition (X O)
    (or (relative-config man n man n man)
        (relative-config man e man e man)
        (relative-config man ne man ne man)
        (relative-config man nw man nw man)
    )
  )
)

 

Posted in Language | Leave a comment

PuzzleScript

PuzzleScript is an open-source HTML5 puzzle game engine. Really a script-based system for creating puzzle games.
http://www.puzzlescript.net/

Increpare Games Ltd is a video game developer based in London, England, founded and operated by Stephen “Increpare” Lavelle in 2004.
http://www.increpare.com/
http://en.wikipedia.org/wiki/Increpare_Games
https://www.patreon.com/increpare

PuzzleScript is written in JavaScript and runs in a Web browser. It is open source.

Here is the code for Sokoban.

title Microban
author David Skinner
homepage www.sneezingtiger.com/sokoban/levels/microbanText.html

(
My favourite set of sokoban levels - here're the first ten of the Microban set.
I tried contacting this guy, but he seems to have vanished from the net. The levels are in lots of places online, so I'm just chancing my arm by including them.  BUT BE WARNED.
)

========
OBJECTS
========

Background 
LIGHTGREEN GREEN
11111
01111
11101
11111     
10111   


Target 
DarkBlue 
..... 
.000.
.0.0.
.000.
.....     

Wall     
BROWN DARKBROWN     
00010
11111
01000
11111
00010

Player 
Black Orange White Blue     
.000.
.111.
22222
.333.
.3.3.

Crate
Orange Yellow
00000
0...0
0...0
0...0
00000


=======
LEGEND
=======

. = Background
# = Wall
P = Player
* = Crate
@ = Crate and Target
O = Target


=======
SOUNDS
=======

Crate MOVE 36772507
endlevel 83744503
startgame 92244503

================
COLLISIONLAYERS
================

Background
Target
Player, Wall, Crate

======
RULES     
======     

[ >  Player | Crate ] -> [  >  Player | > Crate  ]     

==============
WINCONDITIONS
==============

All Target on Crate     

=======     
LEVELS
=======

message level 1 of 10

####..
#.O#..
#..###
#@P..#
#..*.#
#..###
####..

message level 2 of 10

######
#....#
#.#P.#
#.*@.#
#.O@.#
#....#
######

message level 3 of 10

..####...
###..####
#.....*.#
#.#..#*.#
#.O.O#P.#
#########

message level 4 of 10

########
#......#
#.O@@*P#
#......#
#####..#
....####

message level 5 of 10

.#######
.#.....#
.#.O*O.#
##.*P*.#
#..O*O.#
#......#
########

message level 6 of 10

######.#####
#....###...#
#.**.....#P#
#.*.#OOO...#
#...########
#####.......

message level 7 of 10

#######
#.....#
#.O*O.#
#.*O*.#
#.O*O.#
#.*O*.#
#..P..#
#######

message level 8 of 10

..######
..#.OOP#
..#.**.#
..##.###
...#.#..
...#.#..
####.#..
#....##.
#.#...#.
#...#.#.
###...#.
..#####.

message level 9 of 10

#####.
#O..##
#P**.#
##...#
.##..#
..##O#
...###

message level 10 of 10

......#####
......#O..#
......#O#.#
#######O#.#
#.P.*.*.*.#
#.#.#.#.###
#.......#..
#########..

message congratulations!

Posted in Language | Leave a comment

Generalised Game Playing

General game playing is about playing games that you’ve never seen before, figuring out the strategy as you go. It can be done by humans or by intelligent machines. Here are some links.

Web site http://www.ggp.org/
Hosting http://tiltyard.ggp.org/hosting/
Open source base https://github.com/ggp-org/ggp-base
Repository http://ggp-repository.appspot.com/base/
More http://www.general-game-playing.de/
Games http://130.208.241.192/ggpserver/

Game Description Language, or GDL, is a language designed by Michael Genesereth as part of the General Game Playing Project at Stanford University, California. GDL describes the state of a game as a series of facts, and the game mechanics as logical rules. The language is derived from Datalog.

Language https://en.wikipedia.org/wiki/Game_Description_Language
More http://games.stanford.edu/

Source code releases for the base engine are in Java, but there is no generalised user interface.

Here is Tic-Tac-Toe in GDL, courtesy of http://games.stanford.edu/gamemaster/games/tictactoe/tictactoe.kif.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Tictactoe
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Components
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    (role white)
    (role black)

    (<= (base (cell ?m ?n x)) (index ?m) (index ?n))
    (<= (base (cell ?m ?n o)) (index ?m) (index ?n))
    (<= (base (cell ?m ?n b)) (index ?m) (index ?n))
    (base (control white))
    (base (control black))

    (<= (input ?r (mark ?m ?n)) (role ?r) (index ?m) (index ?n))
    (<= (input ?r noop) (role ?r))

    (index 1)
    (index 2)
    (index 3)
  
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    (init (cell 1 1 b))
    (init (cell 1 2 b))
    (init (cell 1 3 b))
    (init (cell 2 1 b))
    (init (cell 2 2 b))
    (init (cell 2 3 b))
    (init (cell 3 1 b))
    (init (cell 3 2 b))
    (init (cell 3 3 b))
    (init (control white))
    
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; legal
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
        
    (<= (legal ?w (mark ?x ?y))
        (true (cell ?x ?y b))
        (true (control ?w)))
    
    (<= (legal white noop)
        (true (control black)))
    
    (<= (legal black noop)
        (true (control white)))
    
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; next
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    (<= (next (cell ?m ?n x))
        (does white (mark ?m ?n))
        (true (cell ?m ?n b)))
    
    (<= (next (cell ?m ?n o))
        (does black (mark ?m ?n))
        (true (cell ?m ?n b)))
    
    (<= (next (cell ?m ?n ?w))
        (true (cell ?m ?n ?w))
        (distinct ?w b))
    
    (<= (next (cell ?m ?n b))
        (does ?w (mark ?j ?k))
        (true (cell ?m ?n b))
        (distinct ?m ?j))
    
    (<= (next (cell ?m ?n b))
        (does ?w (mark ?j ?k))
        (true (cell ?m ?n b))
        (distinct ?n ?k))
    
    (<= (next (control white))
        (true (control black)))
    
    (<= (next (control black))
        (true (control white)))
    
    
    (<= (row ?m ?x)
        (true (cell ?m 1 ?x))
        (true (cell ?m 2 ?x))
        (true (cell ?m 3 ?x)))
    
    (<= (column ?n ?x)
        (true (cell 1 ?n ?x))
        (true (cell 2 ?n ?x))
        (true (cell 3 ?n ?x)))
    
    (<= (diagonal ?x)
        (true (cell 1 1 ?x))
        (true (cell 2 2 ?x))
        (true (cell 3 3 ?x)))
    
    (<= (diagonal ?x)
        (true (cell 1 3 ?x))
        (true (cell 2 2 ?x))
        (true (cell 3 1 ?x)))
    
    
    (<= (line ?x) (row ?m ?x))
    (<= (line ?x) (column ?m ?x))
    (<= (line ?x) (diagonal ?x))
    
    
    (<= open (true (cell ?m ?n b)))
    
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; goal
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    (<= (goal white 100)
        (line x)
        (not (line o)))
    
    (<= (goal white 50)
        (not (line x))
        (not (line o)))
    
    (<= (goal white 0)
        (not (line x))
        (line o))

    (<= (goal black 100)
        (not (line x))
        (line o))
      
    (<= (goal black 50)
        (not (line x))
        (not (line o)))
  
    (<= (goal black 0)
        (line x)
        (not (line o)))
    
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; terminal
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    (<= terminal
        (line x))
    
    (<= terminal
        (line o))
    
    (<= terminal
        (not open))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Posted in GGP/GDL, Language | Leave a comment

First Post

This is the first post for a site about programming languages for Abstract Games and Puzzles, and a player for those games called Polygamo.

Posted in General | Leave a comment