Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,24 @@
|
|||
10 REM GENERATE A RANDOM BUNCH OF INTEGERS
|
||||
20 DIM ARR(20)
|
||||
30 RANDOMIZE TIMER
|
||||
40 FOR I=0 TO 19
|
||||
50 ARR(I)=INT(RND*100)
|
||||
60 NEXT I
|
||||
70 REM bubble sort the list, printing it at the end of every pass
|
||||
80 MX = 19
|
||||
90 CHANGED = 0
|
||||
100 FOR I = 0 TO 19
|
||||
110 PRINT ARR(I);
|
||||
120 NEXT I
|
||||
130 PRINT
|
||||
140 FOR I = 0 TO MX-1
|
||||
150 IF ARR(I)>ARR(I+1) THEN GOSUB 1000
|
||||
160 NEXT I
|
||||
170 MX = MX - 1
|
||||
180 IF CHANGED*MX = 0 THEN END
|
||||
190 GOTO 90
|
||||
1000 TEMP = ARR(I)
|
||||
1010 ARR(I) = ARR(I+1)
|
||||
1020 ARR(I+1) = TEMP
|
||||
1030 CHANGED = 1
|
||||
1040 RETURN
|
||||
Loading…
Add table
Add a link
Reference in a new issue