View Single Post
  #5  
Old 01-11-2007, 12:21 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by Chompy View Post
Both examples are almost the same,
' if (array[b+1] < array[b]) ' is only changing

Nice script tho Gambet

Here is maybe how I would do it
PHP Code:
blah blah blah 
PHP Code:
//#CLIENTSIDE
function onCreated(){
  
temp.example = {1,6,4,25,8,20,100,54,1000,523};
  
doFunction("GreatestToLast"temp.example);
}
function 
doFunction(mode, array) {
  
temp.= (mode=="GreatestToLast"1:(mode=="LeastToGreatest"? -1:0));
  
temp.len temp.array.size();
  for (
temp.0temp.temp.len 1temp.++) {
    for (
temp.0temp.temp.len temp.atemp.++) {
        if (
temp.s*temp.array[temp.1] > temp.s*temp.array[tempb]) {
           
this.temp temp.array[temp.b];
           
temp.array[temp.b] = temp.array[temp.1];
           
temp.array[temp.1] = this.temp;
           
this.results temp.array;
           
player.chat this.results;
        }
      }
    }
  }

Or something of the sort.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote