标签:os new res 函数 height 循环 r ls 参数
1、举例,比方说我想取出横坐标0-900 纵坐标0-400的坐标范围: 
do_all_pos()-> 
do_all_pos([],0,0).
do_all_pos(Result,Length,Height)when Length<900 andalso Height=<400-> 
NewResult=[{Length,Height}|Result], 
NewLength=Length+100, 
do_all_pos(NewResult,NewLength,Height); 
do_all_pos(Result,Length,Height) when Length=:=900 andalso Height<400-> 
NewResult=[{Length,Height}|Result], 
NewHeight=Height+100, 
NewLength=0, 
do_all_pos(NewResult,NewLength,NewHeight); 
do_all_pos(Result,Length,Height) when Length=:=900 andalso Height=:=400-> 
[{Length,Height}|Result].
2、如果是三维坐标求法,则直接在外层调用,不建议用三个函数参数变量来控制
标签:os new res 函数 height 循环 r ls 参数
原文地址:http://my.oschina.net/u/932809/blog/305802