[Coco] Programming in BASIC YouTube series URBANE Version
Stephen H. Fischer
SFischer1 at Mindspring.com
Fri Apr 29 15:03:00 EDT 2016
Agreed, but I cannot download files.
Someone else would need to do it.
But then the resulting post could not be sent to the mailing list as it would be too large.
That's why zip files were invented.
The dim witted (SOME only) that refuse to use facebook and
tandycoco.com/coco-forum are locking themselves out of much that is good.
I will see if a post of the converted Selection Sort does not break the mailing list limit.
SHF
---------------------------------------------
'********************
'* *
'* SELECTION SORT *
'* *
'********************
'
_1100_ ' GENERATE RANDOM DATA
' PMODE 4
' SCREEN 1,0
' DIM NO( 126 )
' PCLS 0
FOR I = 1 TO N
NO( I ) = INT( RND( 190 ) )
HLINE ( I * D, 190 ) - ( I * D, 190 -NO( I )), PSET
NEXT
HCOLOR 3,2: FOR I = 0 TO 80 STEP 16 : HPRINT(I,0)," SELECTION SORT.": NEXT I : HCOLOR 1,2
FOR J = N TO 1 STEP -1
LS = -1: SI = -1
FOR I=1 TO J:IF NO( I ) > LS THEN LS = NO( I ): SI =I: NEXT I ELSE NEXT I
GOSUB _1290_
TM = NO( J ) : NO( J ) = NO( SI ): NO( SI ) = TM
GOSUB _1320_
NEXT J
RETURN
' LINE DISPLAY SUBROUTINES
_1290_ HLINE ( J * D, 190 ) - ( J * D, 0 ),PRESET
HLINE ( ( SI ) * D, 190 ) - ( ( SI ) * D, 0 ), PRESET
RETURN
_1320_ HLINE ( J * D, 190 ) - ( J * D, 190 - NO( J ) ), PSET
HLINE ( ( SI ) * D, 190 ) - ( ( SI ) * D, 190 - NO( SI ) ), PSET
RETURN
More information about the Coco
mailing list