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
signature.asc
Description: This is a digitally signed message part
_________________________________________________________________________________ mozart-users mailing list [email protected] http://www.mozart-oz.org/mailman/listinfo/mozart-users
