From: Jon Harrop <jon@ffconsultancy.com>
To: caml-list@yquem.inria.fr
Subject: Maze generator
Date: Wed, 21 Feb 2007 22:32:45 +0000 [thread overview]
Message-ID: <200702212232.45438.jon@ffconsultancy.com> (raw)
Whilst revamping our website, I took the time to improve the maze generator:
http://www.ffconsultancy.com/ocaml/maze/
it is now 30% shorter and much faster, using an array instead of a functional
map. It also uses continuation passing style instead of an explicit stack.
But it no longer produces PostScript output.
The program uses a simple depth first search. An interesting alternative
algorithm involves keeping track of sets of connection cells and breaking
walls to unify the sets until you have a spanning tree. That should be easy
to code in OCaml but I think it will generate mazes that are much harder to
solve.
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
OCaml for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists
reply other threads:[~2007-02-21 22:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200702212232.45438.jon@ffconsultancy.com \
--to=jon@ffconsultancy.com \
--cc=caml-list@yquem.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox