Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_24.ADF » P/ABC-S

P/ABC-S

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_24.ADF
Filename: P/ABC-S
Read OK:
File size: 0363 bytes
Load address: 1900
Exec address: FFFF8023
Duplicates

There is 1 duplicate copy of this file in the archive:

File contents
   10 REM Alpha sort all done in Basic
   20 REM Basic from here onwards is your program that uses the sorter that follows
   30 CLS
   40 INPUT"NUMBER OF STRINGS ";NUMBER%
   50 IF NUMBER%>1000 THEN PRINT"TOO MANY":GOTO 40:REM Alters depending on screen mode
   60  PRINT
   70 DIM ARRAY$(NUMBER%)
   80 REM Randomly generates 10 letter strings
   90 PRINT:PRINT"STRINGS ARE..."
  100 PRINT
  110 FOR N%=1 TO NUMBER%
  120 string$=""
  130 FOR Z%=1 TO RND(10)
  140 K$=CHR$(RND(26)+64)
  150 string$=string$+K$
  160 NEXT Z%
  170 ARRAY$(N%)=string$
  180 PRINT ARRAY$(N%)
  190 NEXT N%
  200 PRINT:PRINT"NOW SORTING..."
  210 REM Turn timer on,as then sorter follows from here
  220 HERE%=TIME
  230FORY=1TONUMBER%:FORX=1TONUMBER%
  240IFARRAY$(Y)<ARRAY$(X)THENTEMP$=ARRAY$(Y):ARRAY$(Y)=ARRAY$(X):ARRAY$(X)=TEMP$
  250NEXT:NEXT
  260 NOW%=TIME
  270 FOR N%=1 TO NUMBER%
  280 PRINT ARRAY$(N%)
  290 NEXT N%
  300 PRINT:PRINT"SORTED ";NUMBER%;" ITEMS IN ";(NOW%-HERE%)/100;" SECONDS"
  310 REM Time @ 10 lttrs: 1700=ages ; 400=780s ; 100=45s

# � Alpha sort all done in Basic
P � Basic from here onwards is your program that uses the sorter that follows
 �
(" �"NUMBER OF STRINGS ";NUMBER%
2J � NUMBER%>1000 � �"TOO MANY":� �Th@:� Alters depending on screen mode
<  �
F � ARRAY$(NUMBER%)
P+ � Randomly generates 10 letter strings
Z �:�"STRINGS ARE..."
d �
n � N%=1 � NUMBER%
x string$=""
� � Z%=1 � �(10)
� K$=�(�(26)+64)
� string$=string$+K$
�	 � Z%
� ARRAY$(N%)=string$
� � ARRAY$(N%)
�	 � N%
� �:�"NOW SORTING..."
�5 � Turn timer on,as then sorter follows from here
� HERE%=�
��Y=1�NUMBER%:�X=1�NUMBER%
�L�ARRAY$(Y)<ARRAY$(X)�TEMP$=ARRAY$(Y):ARRAY$(Y)=ARRAY$(X):ARRAY$(X)=TEMP$
��:�
 NOW%=�
 � N%=1 � NUMBER%
 � ARRAY$(N%)
"	 � N%
,B �:�"SORTED ";NUMBER%;" ITEMS IN ";(NOW%-HERE%)/100;" SECONDS"
66 � Time @ 10 lttrs: 1700=ages ; 400=780s ; 100=45s
�
00000000  0d 00 0a 23 20 f4 20 41  6c 70 68 61 20 73 6f 72  |...# . Alpha sor|
00000010  74 20 61 6c 6c 20 64 6f  6e 65 20 69 6e 20 42 61  |t all done in Ba|
00000020  73 69 63 0d 00 14 50 20  f4 20 42 61 73 69 63 20  |sic...P . Basic |
00000030  66 72 6f 6d 20 68 65 72  65 20 6f 6e 77 61 72 64  |from here onward|
00000040  73 20 69 73 20 79 6f 75  72 20 70 72 6f 67 72 61  |s is your progra|
00000050  6d 20 74 68 61 74 20 75  73 65 73 20 74 68 65 20  |m that uses the |
00000060  73 6f 72 74 65 72 20 74  68 61 74 20 66 6f 6c 6c  |sorter that foll|
00000070  6f 77 73 0d 00 1e 06 20  db 0d 00 28 22 20 e8 22  |ows.... ...(" ."|
00000080  4e 55 4d 42 45 52 20 4f  46 20 53 54 52 49 4e 47  |NUMBER OF STRING|
00000090  53 20 22 3b 4e 55 4d 42  45 52 25 0d 00 32 4a 20  |S ";NUMBER%..2J |
000000a0  e7 20 4e 55 4d 42 45 52  25 3e 31 30 30 30 20 8c  |. NUMBER%>1000 .|
000000b0  20 f1 22 54 4f 4f 20 4d  41 4e 59 22 3a e5 20 8d  | ."TOO MANY":. .|
000000c0  54 68 40 3a f4 20 41 6c  74 65 72 73 20 64 65 70  |Th@:. Alters dep|
000000d0  65 6e 64 69 6e 67 20 6f  6e 20 73 63 72 65 65 6e  |ending on screen|
000000e0  20 6d 6f 64 65 0d 00 3c  07 20 20 f1 0d 00 46 16  | mode..<.  ...F.|
000000f0  20 de 20 41 52 52 41 59  24 28 4e 55 4d 42 45 52  | . ARRAY$(NUMBER|
00000100  25 29 0d 00 50 2b 20 f4  20 52 61 6e 64 6f 6d 6c  |%)..P+ . Randoml|
00000110  79 20 67 65 6e 65 72 61  74 65 73 20 31 30 20 6c  |y generates 10 l|
00000120  65 74 74 65 72 20 73 74  72 69 6e 67 73 0d 00 5a  |etter strings..Z|
00000130  18 20 f1 3a f1 22 53 54  52 49 4e 47 53 20 41 52  |. .:."STRINGS AR|
00000140  45 2e 2e 2e 22 0d 00 64  06 20 f1 0d 00 6e 15 20  |E..."..d. ...n. |
00000150  e3 20 4e 25 3d 31 20 b8  20 4e 55 4d 42 45 52 25  |. N%=1 . NUMBER%|
00000160  0d 00 78 0f 20 73 74 72  69 6e 67 24 3d 22 22 0d  |..x. string$="".|
00000170  00 82 13 20 e3 20 5a 25  3d 31 20 b8 20 b3 28 31  |... . Z%=1 . .(1|
00000180  30 29 0d 00 8c 13 20 4b  24 3d bd 28 b3 28 32 36  |0).... K$=.(.(26|
00000190  29 2b 36 34 29 0d 00 96  17 20 73 74 72 69 6e 67  |)+64).... string|
000001a0  24 3d 73 74 72 69 6e 67  24 2b 4b 24 0d 00 a0 09  |$=string$+K$....|
000001b0  20 ed 20 5a 25 0d 00 aa  17 20 41 52 52 41 59 24  | . Z%.... ARRAY$|
000001c0  28 4e 25 29 3d 73 74 72  69 6e 67 24 0d 00 b4 11  |(N%)=string$....|
000001d0  20 f1 20 41 52 52 41 59  24 28 4e 25 29 0d 00 be  | . ARRAY$(N%)...|
000001e0  09 20 ed 20 4e 25 0d 00  c8 18 20 f1 3a f1 22 4e  |. . N%.... .:."N|
000001f0  4f 57 20 53 4f 52 54 49  4e 47 2e 2e 2e 22 0d 00  |OW SORTING..."..|
00000200  d2 35 20 f4 20 54 75 72  6e 20 74 69 6d 65 72 20  |.5 . Turn timer |
00000210  6f 6e 2c 61 73 20 74 68  65 6e 20 73 6f 72 74 65  |on,as then sorte|
00000220  72 20 66 6f 6c 6c 6f 77  73 20 66 72 6f 6d 20 68  |r follows from h|
00000230  65 72 65 0d 00 dc 0c 20  48 45 52 45 25 3d 91 0d  |ere.... HERE%=..|
00000240  00 e6 1d e3 59 3d 31 b8  4e 55 4d 42 45 52 25 3a  |....Y=1.NUMBER%:|
00000250  e3 58 3d 31 b8 4e 55 4d  42 45 52 25 0d 00 f0 4c  |.X=1.NUMBER%...L|
00000260  e7 41 52 52 41 59 24 28  59 29 3c 41 52 52 41 59  |.ARRAY$(Y)<ARRAY|
00000270  24 28 58 29 8c 54 45 4d  50 24 3d 41 52 52 41 59  |$(X).TEMP$=ARRAY|
00000280  24 28 59 29 3a 41 52 52  41 59 24 28 59 29 3d 41  |$(Y):ARRAY$(Y)=A|
00000290  52 52 41 59 24 28 58 29  3a 41 52 52 41 59 24 28  |RRAY$(X):ARRAY$(|
000002a0  58 29 3d 54 45 4d 50 24  0d 00 fa 07 ed 3a ed 0d  |X)=TEMP$.....:..|
000002b0  01 04 0b 20 4e 4f 57 25  3d 91 0d 01 0e 15 20 e3  |... NOW%=..... .|
000002c0  20 4e 25 3d 31 20 b8 20  4e 55 4d 42 45 52 25 0d  | N%=1 . NUMBER%.|
000002d0  01 18 11 20 f1 20 41 52  52 41 59 24 28 4e 25 29  |... . ARRAY$(N%)|
000002e0  0d 01 22 09 20 ed 20 4e  25 0d 01 2c 42 20 f1 3a  |..". . N%..,B .:|
000002f0  f1 22 53 4f 52 54 45 44  20 22 3b 4e 55 4d 42 45  |."SORTED ";NUMBE|
00000300  52 25 3b 22 20 49 54 45  4d 53 20 49 4e 20 22 3b  |R%;" ITEMS IN ";|
00000310  28 4e 4f 57 25 2d 48 45  52 45 25 29 2f 31 30 30  |(NOW%-HERE%)/100|
00000320  3b 22 20 53 45 43 4f 4e  44 53 22 0d 01 36 36 20  |;" SECONDS"..66 |
00000330  f4 20 54 69 6d 65 20 40  20 31 30 20 6c 74 74 72  |. Time @ 10 lttr|
00000340  73 3a 20 31 37 30 30 3d  61 67 65 73 20 3b 20 34  |s: 1700=ages ; 4|
00000350  30 30 3d 37 38 30 73 20  3b 20 31 30 30 3d 34 35  |00=780s ; 100=45|
00000360  73 0d ff                                          |s..|
00000363
P/ABC-S.m0
P/ABC-S.m1
P/ABC-S.m2
P/ABC-S.m4
P/ABC-S.m5