Re: Help with Peg Solitaire 15 hole triangle version
From: R Kym Horsell (kym_at_kymhorsell.com)
Date: 08/23/04
- Previous message: Christopher Browne: "Re: Small, Fast Prolog in Lisp?"
- In reply to: jspauli_at_gravity.phys.uwm.edu: "Help with Peg Solitaire 15 hole triangle version"
- Next in thread: R. Kym Horsell: "Re: Help with Peg Solitaire 15 hole triangle version"
- Reply: R. Kym Horsell: "Re: Help with Peg Solitaire 15 hole triangle version"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 22 Aug 2004 21:03:19 -0700
jspauli@gravity.phys.uwm.edu wrote in message news:<82dfbdf.0408211842.97eb5d3@posting.google.com>...
> I am trying to write a program in swi-prolog that solves a 15 hole
> triangle (5 row max) peg solitaire (IQ) game. I have been programming
> in
> traditional imperative languages for quite some time, but thought
> maybe prolog would lend itself to this problem best.
>
> So, for the configuration
[...]
"Depth first search" is a pretty common algorithm in Prolog.
As well as breadth first search. ;-)
Perhaps all you need is to see other puzzle-solving examples.
Choice of the data-structure to represent the state is a key
(after you've done the top-level design!) as it'll govern how
quickly the program will run, as well as how many clauses you'll
need to code it without bugs. :->
For some very simple examples see
http://junk.kymhorsell.com
under the "maze runner" and "knights tour" examples.
(No, I haven't updated these in a while).
================================================================
$ The US had plenty of evidence which suggested that Iraq had WMD, ie
$ they had every reason to believe that Saddam had WMD. Therefore the
$ US saying that they "know" that Iraq has WMD is not a lie [...]
-- Greig Ebeling (greige@bigpnd.com), 13 Jan 2004
[In certain circles, "To Know X" generally involves "X" being true].
- Previous message: Christopher Browne: "Re: Small, Fast Prolog in Lisp?"
- In reply to: jspauli_at_gravity.phys.uwm.edu: "Help with Peg Solitaire 15 hole triangle version"
- Next in thread: R. Kym Horsell: "Re: Help with Peg Solitaire 15 hole triangle version"
- Reply: R. Kym Horsell: "Re: Help with Peg Solitaire 15 hole triangle version"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|