Re: Help with Peg Solitaire 15 hole triangle version

From: R Kym Horsell (kym_at_kymhorsell.com)
Date: 08/23/04

  • Next message: Henry Polley: "Gprolog and QT"
    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].


  • Next message: Henry Polley: "Gprolog and QT"

    Relevant Pages

    • Re: Palestinians Under Attack
      ... I'd say two things overall on the entire sordid mess of WMD in Bush's ... decision, ratified by both Congress and the UN, to go to war against ... Saddam in Iraq: ...
      (rec.photo.digital)
    • Re: Palestinians Under Attack
      ... I'd say two things overall on the entire sordid mess of WMD in Bush's ... Saddam in Iraq: ... weapons program. ... Washington DC, 11 May, 2001 ...
      (rec.photo.digital)
    • Re: Top Ten Bush Lies
      ... Saddam supplied financial aid to the Philippine terrorist organization Abu ... Bin Laden had visited Iraq and was in communication with ... Camera report on a CU speech by former Iraqi weapons inspector ... transported WMD to Syria six weeks before Operation Iraqi Freedom began. ...
      (alt.guitar.amps)
    • Re: OT: Bombing Iran
      ... are plenty of countries that have worse than what Saddam had. ... not using any of these alledged weapons to threaten the US, ... Iraq was invaded as part of a neo-con global energy strategy. ... transported WMD to Syria six weeks before Operation Iraqi Freedom began. ...
      (alt.guitar.amps)
    • Half of US STILL Believes Iraq had WMD
      ... Half of US STILL Believes Iraq had WMD ... Via NY Transfer News Collective * All the News that Doesn't Fit ... deliberately withheld from inspectors by the Iraqis." ...
      (soc.culture.iraq)