Skip to content
/ pousse Public

Artificial intelligence playing a French board game. Basically it does a lot of number crunching and alpha-beta based lookups to provide a strong game play. It also makes some nasty errors by keeping the stackframe around for an extended period thus preventing the handling of other events. The excuse is that this runs in a terminal window, where…

License

Notifications You must be signed in to change notification settings

zsombor/pousse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is this?

Pousse is a French game similar to tic-tac-toe. However unlike it’s simpleton
cousin this game is anything but trivial. Pousse is played on an N by N board.
For example the board for the 5 by 5 variant:

.....
.....
.....
.....
.....

The two opposing players (X and O) push their pieces from one of the four sides.
On an N by N board there are 4 x N possible moves at every step. Moves can be
represented by descriptions such as “right 0”. Latter means push an element
from the right on the 0th row. Or “bottom 3” that pushes from the bottom on
the column number 3. Because I’m a geek columns / rows are numbered from 0.

This is how the starting table looks after X making a “top 0” move:

X....
.....
.....
.....
.....

Inserted pieces forcefully push other pieces along in their direction of movement.
Probably why the game is called pousse in French. Blank positions, represented
with dots, are nothing more than a canvas for other pieces to cross. Here is what
happens after the opponent replies with a “left 0” move:

OX...
.....
.....
.....
.....

A simple example on how blank squares absorb the push, is when X replies back
with “right 0” move:

OX..X
.....
.....
.....
.....

If a piece sits on the edge of the board, it is may be pushed off during a move.
When this happens the piece in effect fall off the board.

The object of the game is to create a full line / column of pieces of your own type.
Whomever achieves this first wins. Another way of winning is forcing the opponent
to repeat a previously encountered board position. Draw is not possible, someone
will always win.

For example the next game was won by X:

XOO..
XO.O.
XXOOO
XOXXO
XX..X

Interactive Play

For now use

$cake play

and enter moves on an command line prompt.

Developing

First install nodeunit via

$npm install nodeunit

then run the tests via

$cake test

In addition after making a change you should test if the AI strength
had improved or not. Do this by spawninga server with the
new changes and play it against a client on a clean base checkout.

$cake server
$cake client

Unless you introduced some bugs, these two will automatically play a tournament
of 1000 games where the right of first move is toggled back and forth. Most board
games give an advantage to the first mover hence the need for toggling. Any AI
improvments should be visible by the server dominating the client.

Copyright © 2011 by Dee Zsombor <zsombor@primalgrasp.com>

About

Artificial intelligence playing a French board game. Basically it does a lot of number crunching and alpha-beta based lookups to provide a strong game play. It also makes some nasty errors by keeping the stackframe around for an extended period thus preventing the handling of other events. The excuse is that this runs in a terminal window, where…

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published