Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sorting numbers - FiliSort
#3
here is 20,000 random numbers between -50 and 50 that took no time to sort!!!

Code: (Select All)

DefLng A-Z
Screen _NewImage(800, 700, 32)


tn = 20000 ' total numbers to sort
Dim Shared n(-5000000 To 5000000)

Randomize Timer
For i = 1 To tn: num = (Rnd * 100 - 50) * 100000: n(num) = n(num) + 1: Next i

timer1! = Timer
t1 = Timer(.001)
Print "Sorting..."; tn; "numbers": Print "Timer starts:"; timer1!
timer2! = Timer
t2 = Timer(.001)
Print "Timer ends:"; timer2!; "    Seconds:"; (timer2! - timer1!) '/ 1.18
Print "Timer(.001) time is:"; (t2 - t1); "secs"
Print
Print "press any to see sorted numbers... zzz"
Sleep
For k = -5000000 To 5000000
    If n(k) Then
        For i = 1 To n(k)
            Print k / 100000
        Next
    End If
Next k

End

Update: This is for entertainment purposes ONLY don't take this seriously (unless the method comes in handy Smile ).

Notice: No DATA has been corrupted in the making of this bit of entertainment. Please do not launch rockets or do brain surgery with this code!
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


Messages In This Thread
Sorting numbers - FiliSort - by 2112 - 03-08-2026, 04:34 PM
RE: Sorting numbers - FiliSort - by bplus - 03-08-2026, 05:38 PM
RE: Sorting numbers - FiliSort - by bplus - 03-08-2026, 05:55 PM
RE: Sorting numbers - FiliSort - by SMcNeill - 03-08-2026, 06:55 PM
RE: Sorting numbers - FiliSort - by bplus - 03-08-2026, 07:27 PM
RE: Sorting numbers - FiliSort - by 2112 - 03-08-2026, 06:51 PM
RE: Sorting numbers - FiliSort - by SMcNeill - 03-08-2026, 07:06 PM
RE: Sorting numbers - FiliSort - by PhilOfPerth - 03-10-2026, 08:19 AM
RE: Sorting numbers - FiliSort - by SMcNeill - 03-10-2026, 09:21 AM
RE: Sorting numbers - FiliSort - by PhilOfPerth - 03-10-2026, 10:17 PM
RE: Sorting numbers - FiliSort - by bplus - 03-10-2026, 10:46 PM
RE: Sorting numbers - FiliSort - by PhilOfPerth - 03-11-2026, 12:48 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Using the tenary operator in C with 3 numbers Kernelpanic 16 4,259 09-13-2024, 06:06 AM
Last Post: Jack
  Test sorting algorithms eoredson 3 1,014 05-04-2023, 09:38 PM
Last Post: eoredson
  Serial Numbers AtomicSlaughter 1 807 03-13-2023, 05:45 PM
Last Post: mnrvovrfc

Forum Jump:


Users browsing this thread: 1 Guest(s)