DECLARE SUB BUBBLE (X%(), N%) DEFINT A-Z CLS DIM A(20) FOR J = 0 TO 19: A(J) = INT(20 * RND): PRINT USING "####"; A(J); : NEXT J PRINT BUBBLE A(), 20 FOR J = 0 TO 19: PRINT USING "####"; A(J); : NEXT J END DEFSNG A-Z SUB BUBBLE (X%(), N%) DEFINT A-Z FOR I = 1 TO N - 1 FOR J = N - 1 TO I STEP -1 IF X(J - 1) > X(J) THEN TMP = X(J - 1): X(J - 1) = X(J): X(J) = TMP END IF NEXT J NEXT I END SUB