Neil,
I believe you are making wrong assumptions about Revise. As I
understand it, it should be called with a list of integers and not a
list of tuples. A list [3 1 2] corresponds to positions 3#3,1#2,2#1
with the second coordinate being the length of the list up to this
number. The list of pairs is generated by the BuildList function when
needed. Also, the Queens function should be called with an empty list
with the result being generated by the application. Otherwise it looks
very nice and should work.
/pavel

On Mon, Aug 18, 2008 at 8:28 PM, Torsten Anders
<[EMAIL PROTECTED]> wrote:
> Dear Neil
>
> Perhaps the "Finite Domain Constraint Programming in Oz. A Tutorial." helps,
> it explains how to do N-Queens with constraint programming as one of its
> examples.
>
> http://www.mozart-oz.org/documentation/fdt/node25.html#section.scripts.queens
>
> "Concepts, Techniques and Models of Computer Programming" discusses how to
> do the N-Queens problem using logic programming (page 629).
>
> Best
> Torsten
>
> On Aug 18, 2008, at 6:54 PM, Neil Munro wrote:
>
>> Hey all
>>          I am a university student studying programming paradigms using
>> mozart oz and have to solve the N queens problem, however the dead line is
>> coming up real soon and I've been working as hard as I can, but ultimately
>> two funerals coupled with the fact I just don't understand Mozart Oz very
>> well, and I'm really struggling. I'm currently working on a function, called
>> Queens, which purpose is to solve the N queens problem, however some of the
>> code particularly the Revise function (which queens heavily relies on) was
>> provided by my tutor in a previous assignment and I must confess I do not
>> understand Revise at all.
>>
>> I have also noticed an issue in revise (since the original function was
>> using on plain integer values not tuples(?) in the form of row#col), that H
>> is compared against BoardSize but this will never be true, since BoardSize
>> is an integer and H is a row#col. I attempted to replace H in this context
>> with {GetLengthOfList L} but to no avail.
>>
>> Would anyone be able to explain a few things, perhaps show me where I am
>> going wrong? I have attached the file I am working so anyone can view it.
>>
>> Thanks
>> Neil Munro
>> <ICA.oz><ATT00001.txt>
>
> --
> Torsten Anders
> Interdisciplinary Centre for Computer Music Research
> University of Plymouth
> Office: +44-1752-586219
> Private: +44-1752-558917
> http://strasheela.sourceforge.net
> http://www.torsten-anders.de
>
>
>
>
>
> _________________________________________________________________________________
> mozart-users mailing list
> [email protected]
> http://www.mozart-oz.org/mailman/listinfo/mozart-users
>
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to