捷徑問題
Author: 藍邦偉　老師

終點

捷徑問題

m = 7 (slider from 1 to 20, step 1)
n = 6 (slider from 1 to 20, step 1)
a = 0.1 (slider from 0 to 1, step 0.1)
k = 26 (slider from 0 to 100, step 1)
list1 = Sequence(Segment[(0.0, i), (n, i)], i, 0.0, m)
list2 = Sequence(Segment[(i, 0.0), (i, m)], i, 0.0, n)
list3 = Join({Sequence[1.0, i, 1.0, n], Sequence[0.0, j, 1.0, m]})
list4 = Sort(Sequence[(a * 0.0 + random(), Element[list3, i]), i, 1.0, m + n])
list5 = Sequence(y(Element[list4, i]), i, 1.0, m + n)
list6 = Join({{(0.0, 0.0)}, Sequence[(Element[list5, i], 1.0 - Element[list5, i]), i, 1.0, m + n]})
list7 = Sequence(Sum[list6, i], i, 1.0, m + n + 1.0)
list8 = Sequence(Vector[Vector[Element[list7, i], Element[list7, i + 1.0]]], i, 1.0, k)