Plot 4 in Haskell
(Also called Connect 4)
This is the page for the game Plot 4 that I implemented
in Haskell.
Plot 4
Plot 4, also called Connect 4, is a simple game. You have
a grid (in our case with seven columns and six rows).
There are two players, one having red coins and the other
having yellow coins. The players take turns alternately
to drop a coin in any column. The player who gets four
of his coins in a line (vertical or horizontal or
diagonal), wins.
This program provides four player modes.
- Human
- Low Skilled Computer
- Medium Skilled Computer
- High Skilled Computer
\section {Motivation}
I wrote this program when I got fascinated by game
tree search. I wanted to try out the algorithm and
see what results it shows.
The game tree search routines have been implemented
as a separate library (there's just one function there
as I write this, but I plan to add more).
The wonderful higher order
nature of Haskell enables one to capture computational
patterns in a higher order function. Therefore, the
game tree search functions in the library can be
used for any game with two players taking alternate
turns.
A request
Please do give me any kind of feedback whatsoever, on the source or the game.
Also, if you build the source on any platform, the binary for which is not
available on this page, please do send the binary to me at
srineet at yahoo dot com (written that way in the hope of
tricking the automated spambots).
Screenshot
The source
Nice readable/printable plot4.pdf (view using the free Acrobat Reader).
The literate Haskell plot4.lhs (I have renamed it to plot4.lhs.txt
because my hosting service won't show files with unknown extensions)
The Game Tree Search library GameTreeSearch.lhs (I have renamed it to GameTreeSearch.lhs.txt
because my hosting service won't show files with unknown extensions)
Nice readable/printable pdf (yet to come).
Binaries
-
Windows 2000: plot4.zip(containing just plot4.exe, compressed using the free Winzip)
Home