Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Bubble Sorting and Binary Chopping

Author
Message
TogaMario
22
Years of Service
User Offline
Joined: 30th Jan 2003
Location:
Posted: 10th Mar 2003 19:19
Someone please help me to understand how I can use these methods in my game(or just a description or example in general). Particularly in testing to see if the player is above matrix or has come in contact with a .X file. Thanks.
P.S. This is what the alphabet would look like if Q and R were eliminated.
Xoid
22
Years of Service
User Offline
Joined: 8th Mar 2003
Location:
Posted: 10th Mar 2003 19:35
Bubble sort is pretty slow when sorting large amount of data, but it's very simple to code.

other sorting techniques you could consider are insertion sort, quicksort, treesort etc...

Hope it helps

Bubble Sort
(Pseudocode)
============

n=<max num of values to be sorted>

repeat
flag = false
for n = 1 to n-1
if array[n] > array[n+1]
swap records
flag=true
endif
next n
dec(n)
until flag=false OR n=1
Andy Igoe
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 10th Mar 2003 19:43
Checking if player is above matrix is simple...


Sorting order of something?


Pneumatic Dryll, Outrageous epic cleric of EQ/Xev
God made the world in 7 days, but we're still waiting for the patch.

Login to post a reply

Server time is: 2025-05-19 06:06:22
Your offset time is: 2025-05-19 06:06:22