Sorting algorithms/Insertion sort: Difference between revisions
→{{header|Craft Basic}}
Basicgames (talk | contribs) |
Basicgames (talk | contribs) |
||
Line 2,024:
sub fill
let list[i] = int: (rnd) * 100
return
Line 2,037 ⟶ 2,034:
sub sort
let value = list[i]
Line 2,049 ⟶ 2,044:
let p = j + 1
let list[p] = list[j]
let j = j - 1
Line 2,059 ⟶ 2,053:
let p = j + 1
let list[p] = value
wait
return
Line 2,069 ⟶ 2,062:
sub show
print i, ": ", list[i]
next i
return</syntaxhighlight>
|