【发布时间】:2017-01-17 09:32:16
【问题描述】:
我得到了
syntax error before: 'end'
每次我为作业运行此代码时:
closest(_P, _PointList) ->
case (length(_PointList =:= 0)) of
true -> {0,0};
false -> closest(_P, tl(_PointList), distance(_P, hd(_PointList)), 1)
end.
% Llength = length(_P),
closest(P, _PointList, _Distance, _Index) ->
case (length(_PointList =:= 0)) of
true -> {_Index, _Distance};
false ->
New_Distance = min(_Distance, distance(_P, hd(_PointList)),
case (New_Distance < _Distance) of
true -> closest(_P, tl(_PointList), New_Distance, _Index + 1);
false -> closest(_P, tl(_PointList), _Distance, _Index)
end
end
end.
有人可以帮我弄清楚为什么会这样吗?谢谢
【问题讨论】:
标签: erlang