Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,31 @@
PROGRAM BUBBLE_SORT
DIM FLIPS%,N,J
DIM A%[100]
BEGIN
! init random number generator
RANDOMIZE(TIMER)
! fills array A% with random data
FOR N=1 TO UBOUND(A%,1) DO
A%[N]=RND(1)*256
END FOR
! sort array
FLIPS%=TRUE
WHILE FLIPS% DO
FLIPS%=FALSE
FOR N=1 TO UBOUND(A%,1)-1 DO
IF A%[N]>A%[N+1] THEN
SWAP(A%[N],A%[N+1])
FLIPS%=TRUE
END IF
END FOR
END WHILE
! print sorted array
FOR N=1 TO UBOUND(A%,1) DO
PRINT(A%[N];)
END FOR
PRINT
END PROGRAM