Yeah that got it working, and your right there was no need for those
variables to be there, been staring at the code too long and didn't notice
the obvious staring me in the face.
Thanks a lot. :)
Neil Munro
2008/7/30 Ryan Kelly <[EMAIL PROTECTED]>
>
> Hi Neil,
>
> I'm not sure of the purpose of the L,W,R variables or why they're
> declared outside the scope of the Attack function, but I think they're
> what's causing you trouble. The below version with these variables
> removed seems to work fine for me.
>
> ----
>
>
> fun {Attack U V}
> case U of XI#YI then
> case V of XII#YII then
> if U.1 == V.1 then
> true
> elseif U.2 == V.2 then
> true
> elseif ( XI - XII ) == ( YI - YII) then
> true
> elseif ( XI - XII ) == ( YII - YI ) then
> true
> else
> false
> end end end
> end
>
> fun {Threaten L U}
> case L of H|T then
> {Attack H U} orelse {Threaten T U}
> else
> false
> end
> end
>
> {Browse {Threaten [1#2 4#5 8#8] 8#4}}
>
>
> ----
>
>
> One guess is that the following lines are blocking, preventing your
> function from returning properly:
>
> L = 993 div BoardSize
> W = 650 div BoardSize
>
> Is BoardSize bound when the function is called?
>
> Also, if you just want to declare L,W,R as local variables for a
> function you don't need to use the "local" statement, you can simply do
> this:
>
> fun {Attack U V}
> L, W, R
> in
> ...etc...
> end
>
>
>
> Hope this helps,
>
> Ryan
>
>
> --
> Ryan Kelly
> http://www.rfk.id.au | This message is digitally signed. Please visit
> [EMAIL PROTECTED] | http://www.rfk.id.au/ramblings/gpg/ for details
>
>
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users