in reply to Yet Another :: N-Queens Solution

++. I'd suggest you use a slightly different format -- 'x', 'y', and 'q' are consufing.

I remember I did something similar for my homework once (in C++): http://rm-f.net/~dmitri/#code.

Replies are listed 'Best First'.
Re: Re: Yet Another :: N-Queens Solution
by Elgon (Curate) on Feb 12, 2003 at 18:32 UTC

    Thanks Dmitri,

    I've added a small bit of extra code to make the written file contain 'X' and 'O' as the queens and empty spaces respectively.

    I've tested it up to n=12 now, which takes about 2 1/2 hours on my P120 laptop (Debian with X and enlightenment running.) I wrote it just for fun, as I don't come from a rigorous programming background but am trying to work through some of the things that a CS undergrad would have to do.

    Elgon

    "What this book tells me is that goose-stepping morons, such as yourself, should read books instead of burning them."
           - Dr. Jones Snr, Indiana Jones and the Last Crusade