Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,34 @@
|
|||
SUB gnomeSort (a() AS LONG)
|
||||
DIM i AS LONG, j AS LONG
|
||||
i = 1
|
||||
j = 2
|
||||
WHILE (i < UBOUND(a) + 1)
|
||||
IF (a(i - 1) <= a(i)) THEN
|
||||
i = j
|
||||
INCR j
|
||||
ELSE
|
||||
SWAP a(i - 1), a(i)
|
||||
DECR i
|
||||
IF 0 = i THEN
|
||||
i = j
|
||||
INCR j
|
||||
END IF
|
||||
END IF
|
||||
WEND
|
||||
END SUB
|
||||
|
||||
FUNCTION PBMAIN () AS LONG
|
||||
DIM n(9) AS LONG, x AS LONG
|
||||
RANDOMIZE TIMER
|
||||
OPEN "output.txt" FOR OUTPUT AS 1
|
||||
FOR x = 0 TO 9
|
||||
n(x) = INT(RND * 9999)
|
||||
PRINT #1, n(x); ",";
|
||||
NEXT
|
||||
PRINT #1,
|
||||
gnomeSort n()
|
||||
FOR x = 0 TO 9
|
||||
PRINT #1, n(x); ",";
|
||||
NEXT
|
||||
CLOSE 1
|
||||
END FUNCTION
|
||||
Loading…
Add table
Add a link
Reference in a new issue