I set up a function that extracts the values from the 4-dimensional array by changing the Y value, and I put the values into a new array, the array should be [0,16/3,0,4/3],but the array is not what I want, and I want to know what’s wrong with my code

```
#
edge=[[0,1,1,1],[3,-14,4,1],[0,6,4,4],[3,-2,4,1]]
num=4
Infinity=1.0/0
def get_point(y,num,edge)
k=0
b=1
y_max=2
y_min=3
x=[ ]
num.times do |i|
if (y<=edge[i][y_max])&&(y>=edge[i][y_min])
if edge[i][k]==Infinity
x[i]=edge[i][k]
elsif edge[i][k]==0
x[i]=edge[i][b]
else
x[i]=(y-edge[i][b])/edge[i][k]
end
else
x[i]=0
end
end
p x
end
get_point(2,num,edge)
```