1 DIM A, 10
2 LOOP I, 10; A[I] = RAND(100); P.A[I]; LOOPEND
3 P. "----"
4 .MAIN; FOUND = 0
5 LOOP I, 9
6 (A[I] > A[I+1]):LET ((A[I],A[I+1]) = (A[I+1],A[I]), FOUND = 1)
7 LOOPEND
8 FOUND:GOTO MAIN
9 LOOP I, 10; P.A[I]; LOOPEND
