>>96070851
>>96101840
Also, here's some bullshit i wrote in nim that probably doesn't work
#[--------------------------------------------------]#
#my attempt at robot arm movement problem
type
Plane = object
x: seq[float]
y: seq[float]
Robot = object
posx: float
posy: float
proc move(xpoint: Plane, ypoint: Plane): float =
var r: Robot
xpoint.x = @[0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.7]
ypoint.y = @[0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.7]
for i in xpoint.x:
i = i + 1
for j in ypoint.y:
j = j + 1
while i > 0 & i < xpoint.x[i] & j > 0 & j < ypoint.y[j - 1]:
r.posx = inc i
r.posy = inc j
while i < 0 & i > xpoint.x[i] & j < 0 & j > ypoint.y[j + 1]:
r.posx = dec i
r.posy = dec j
return i
return j
proc pSort(p: Plane): Plane =
px: Plane = p.x[0]
py: Plane = p.y[0]
i = 0
while px & py < px[7] & py[7]:
i = i + 1
px[i] & py[i] < p[i - 1]
move(px[i] & py[i])
return px & py
proc conn(x: float, y: float): float =
x = x + 1
y = y - 1
return x * y
proc dist(x: float, y: float): float =
x = x + 1
y = y - 1
return x / y
proc cSort(p: Plane): Plane =
let n = p[7]
for i in n - 1:
do
d = Inf
for s & t in n.x & x.y:
if dist(s,t) < d:
s[n.x] = s & t[n.y] = t & d = dist(s, t)
conn(s[n], t[n])
connt(s, t)
proc oSort(p: Plane): Plane =
d = Inf
for n in p[n]:
if cost(p[n]) <= d:
d = cost(p[n]) & p[0] = p[n]
return p[0]