100 CLS					'CLEAR SCREEN
110 DIM A$(20)				'ARRAY FOR DATA
120 FOR I = 1 TO 19			    'SETUP FOR DATA TO ARRAY
130 READ B$				    'READ DATA ITEM
140 A$(I) = B$				    'MOVE TO ARRAY
150 NEXT I				    'CONTINUE TIL DONE
155 FOR I = 0 TO I8 STEP 2			    'LOOP FOR ARRAY DISPLAY
160 GOSUB 20000				    'DISPLAY ARRAY
165 NEXT I				    'LOOP
170 SW = 0				'SET CHANGE FLAG
175 P = P+1				'BUMP PASS COUNT
180 FOR I = 0 TO 18			    'SETUP LOOP FOR SORT
190 IF A$(I) <= A$(I+1) GOTO 240		    'GO IF SORTED ( 2 ITEMS )
200 B$ = A$(I)				    'TEMPORARY STORAGE
210 A$(I) = A$(I+1)			    'MOVE ITEM UP
220 A$(I+1) = B$				    'MOVE ITEM DOWN
230 SW = 1				    'SET CHANGE FLAG
235 GOSUB 20000				    'DISPLAY CHANGE
240 NEXT I				    'CONTINUE WITH LOOP
245 PRINT "PASS";P;			'PRINT PASS COUNT
250 IF SW = 1 GOTO 170			'GO AGAIN IF CHANGE
260 PRINT "SORT DONE"			'DONE
270 END
300 DATA "ELECTRON","LA SMOG","DIAMOND","PEA","MARBLE"
310 DATA "#3 BEARING","FABERGE EGG","BASEBALL","ORANGE","BOWLING BALL"
320 DATA "BALLON","BALL OF STRING","747 TIRE","DOUGHNUT","GOODYEAR BLIMP"
330 DATA "PERSPHERE","RAMA","PHOBOS","MARS","EARTH"
20000 PRINT				'SEPERATOR
20010 FOR I = 0 TO 19
20020 PRINT A$(I)
20030 NEXT I
20040 RETURN
