![]() |
Parallel Image processing with Mathematica and algorithms in CWeb.
Pages for the documentation of my research at University Leipzig.
Maintained by Patrick Scheibe. |
|
Quad is an implementation of the original game Quarto invented by Blaise Muller in the 90's. It is a complex variant of the Four Wins game since in Quad every gaming piece has not only one but four characteristics. They are Color, Size, Shape and Hole/No-Hole. It is played on a 4x4 board and one speciality is that you put a piece which was selected from your opponent.
This project was part of a lecture exercise. Therefore my task was to implement it in a purely functional programming language and to use OpenGL as graphics library. I decided to use Haskell which supported OpenGL. In this case the biggest hitch was to get the stuff compiling since the especially the OpenGL library wasn't maintained very good. I don't think the code compiles without changes today since they change the spec of Haskell and the libs very often. But the latest release without AI can be found here (quad20050406.tar.bz2).
Since some of my friends showed big interest in the stuff we hacked a tree-search AI to the game in the last winter holidays. The code is anywhere on my hard-disk. If someone is really interested then he can have a copy.
Since I stumbled very often over questions concerning Julia-Sets I decided one night to write a very complete tutorial which assumes almost none of the mathematical prerequisites. This tutorial is available in German only and it can be downloaded here
In Mathematica you can easily do a conditional iteration with the function
NestWhile. Therefore the Julia-Set iteration over a matrix of points in the complex plane
is a short statement. Using ArrayPlot for visualisation solves the Julia-Set exercise in
in a few minutes (I'm remembering this being a two-week task in my C-Language lesson at university).
ArrayPlot[#, ColorFunction -> "ThermometerColors"] &@
Table[
First@NestWhile[
{First@# + 1, (Last@#^2 + (0. + 0.8 I))} &,
{1, (i + I j)},
Abs[Last@#] < 2 &],
{i, -0.1, 0.1, 0.0001}, {j, -0.1, 0.1, 0.0001}]