2014-10-01 136 views

回答

0
function get_left(max) 
    i = 0 
    j = 1 
    ls = {} 

    repeat 
     i = i + 1 
     j = j + i - 1 
     ls[i] = j 
     print (ls[i], " ls") 
    until j >= max 

    return ls 
end 

a = get_left(27) 

(需要格式化爲代碼-.-)

if the point1 is between a[i] and a[i+1] 
if then point2 is still between a[i] and a[i+1] it is on the same line 
else if point2 is between a[i + n] and a[i + n + 1] 
then if point2 is at a[i + n] + (a[i] - point1) + n + 1 its in a strait line right above it 
else if point2 is at a[i + n] + (a[i] - point1) + n - 1 its in a strait line left above it 

if for all points n or n*(-1) is equal the distance between the points is equal. 

也就是說,如果我沒有做任何邏輯錯誤,你可能要檢查更多的錢才能正常工作。

這是一個比盧阿更數學的問題,我建議給它添加一個數學標籤。