Home > front end >  The sort order numerical character combinations.
The sort order numerical character combinations.

Time:10-30

 
Number/name///////gender/age/force//political////intelligence command//charm
Var a1=new Array (" 001 ", "sima yi", "male" and "18", "63", "93", "96", "98", "87");
Var a2=new Array (" 002 ", "zhuge liang", "male" and "18", "44", "95", "100", "92", "92");
Var a3=new Array (" 003 ", "sun shangxiang", "female", "18", "86", "63", "67", "72", "86");
Var a4=new Array (" 004 ", "xh", "male" and "18", "91", "61", "54", "87", "80");
Var a5=new Array (" 005 ", "ahearn", "female", "18", "41", "87", "88", "51", "79");
Var a6=new Array (" 006 ", "pang tong", "male" and "18", "62", "85", "97", "78", "69");
Var a7=new Array (" 007 ", "liu", "male" and "18", "73", "78", "74", "75", "99");
Var a8=new Array (" 008 ", "sun quan", "male" and "18", "67", "89", "80", "76", "95");
Var a9=new Array (" 009 ", "tracing the cause", "male" and "18", "69", "87", "95", "96", "90");
Var a10=new Array (" 010 ", "zhou yu", "male" and "18", "30", "23", "94", "30", "62");
Var a11=new Array (" 011 ", "xun yu", "male" and "18", "58", "98", "95", "52", "93");
Var a12=new Array (" 012 ", "huang zhong", "male" and "18", "93", "52", "60", "86", "75");
Var a13=new Array (" 013 ", "cao cao", "male" and "18", "78", "94", "91", "96", "96");
Var a14=new Array (" 014 ", "Angle", "male" and "18", "38", "80", "86", "86", "98");
Var a15=new Array (" 015 ", "the sable cicada", "female", "18", "38", "65", "81", "30", "94");
Var a16=new Array (" 016 ", "lombardi", "male" and "18", "69", "73", "70", "81", "90");
Var a17=new Array (" 017 ", "freeze", "male" and "18", "50", "79", "90", "70", "58");
Var a18=new Array (" 018 ", "country", "male" and "18", "48", "84", "98", "51", "78");
Var a19=new Array (" 019 ", "wa surname" and "female", "18", "67", "66", "91", "53", "94");
Var a20=new Array (" 020 ", "xelloss", "male" and "18", "71", "86", "83", "70", "82");
Var a21=new Array (" 021 ", "cao cao", "male" and "18", "64", "80", "93", "84", "81");
Var a22=new Array (" 022 ", "giffin", "male" and "18", "49", "85", "97", "86", "57");
Var a23=new Array (" 023 ", "Mr. Zhang", "male" and "18", "32", "97", "84", "42", "80");
Var a24=new Array (" 024 ", "lu su", "male" and "18", "56", "90", "92", "80", "89");
Var a25=new Array (" 025 ", "Joe", "female", "18", "31", "77", "73", "33", "92");
Var a26=new Array (" 026 ", "big Joe", "female", "18", "31", "78", "72", "34", "92");
Var a27=new Array (" 027 ", "Chen gong", "male" and "18", "55", "83", "89", "78", "68");
Var a28=new Array (" 028 ", "hua tuo", "male" and "18", "29", "72", "68", "29", "70");
Var a29=new Array (" 029 ", "Mr Xiahou 悙", "male" and "18", "90", "70", "58", "89", "81");
Var a30=new Array (" 030 ", "Ma Yunlu", "male" and "18", "83", "46", "53", "78", "77");
Var a31=new Array (" 031 ", "sun hae-chan", "male" and "18", "73", "46", "70", "84", "77");
Var a32=new Array (" 032 ", "zhang liao", "male" and "18", "92", "58", "78", "93", "78");
Var a33=new Array (" 033 ", "d", "male" and "18", "97", "26", "47", "88", "82");
Var a34=new Array (" 034 ", "lu", "male" and "18", "100", "13", "38", "87", "40");
Var a35=new Array (" 035 ", "zhaoyun", "male" and "18", "96", "65", "76", "91", "81");
Var a36=new Array (" 036 ", "sun ce", "male" and "18", "92", "70", "69", "92", "92");
Var a37=new Array (" 037 ", "sitton," "male" and "18", "94", "25", "38", "78", "38");
Var a38=new Array (" 038 ", "guan yu", "male" and "18", "97", "62", "75", "95", "93");
Var a39=new Array (" 039 ", "this", "male" and "18", "94", "18", "76", "86", "58");
Var a40=new Array (" 040 ", "jiang", "male" and "18", "89", "67", "90", "90", "80");
Var room a41=new Array (" 041 ", "lv meng", "male" and "18", "81", "78", "89", "91", "82");
Var a42=new Array (" 042 ", "lamere", "male" and "18", "93", "32", 46 ", "79", "53");
Var a43=new Array (" 043 ", "coppage", "male" and "18", "88", "48", "74", "72", "71");
Var a44=new Array (" 044 ", "tardif", "male" and "18", "93", "58", "66", "82", "79");
Var a45=new Array (" 045 ", "sun chien", "male" and "18", "90", "73", "74", "93", "91");
Var a46=new Array (" 046 ", "dong zhuo", "male" and "18", "87", "19", "69", "74", "37");
Var a47=new Array (" 047 ", "coss", "male" and "18", "86", "46", "56", "89", "76");
Var a48=new Array (" 048 ", "dian wei", "male" and "18", "95", "29", "53", "76", "58");
Var a49=new Array (" 049 ", "make the", "male" and "18", "96", "20", "43", "65", "59");
Var a50=new Array (" 050 ", "zhang fei", "male" and "18", "98", "22", "40", "85", "45");

Var a=new Array (a1, a2, a3, a4, a4, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33, a34, a35 and a36, a37, a38, a39, a40, room a41, a42, a43, a44, a45, a46, a47, a48, a49, a50);


With array as above, I want to do a sorting, let 50 a one-dimensional array with the force value of descending,

Used the sort method, but a simple sort of force value, but when I add name is out-of-order, the following
 
Var o=[];
for(var i=0; i{
Var p=a [I] a [I] [4] + [1] + "\ n";
O.p ush (p);
}
Grown ort (function (m1, m2) {return m2 and m1});
Alert (o);


If I have to join name makes the entire force value increased? Strives for the bigwigs doubt dispels doubts,,,

CodePudding user response:

Wait,, with amateurs

CodePudding user response:

You added my name that's not becomes: such as sima yi 63, 44 zhuge liang... Do you think this string can directly operation?

CodePudding user response:

refer to the second floor jack5246 response:
you add the name not becomes: such as sima yi 63, 44 zhuge liang... Do you think this string can directly operation?


Right, I also know that is the problem, but I don't know how to solve the,,, big brother for help

CodePudding user response:

To put the name into the type

CodePudding user response:

reference shigecainiao reply: 3/f
Quote: refer to the second floor jack5246 response:

You added my name that's not becomes: such as sima yi 63, 44 zhuge liang... Do you think this string can directly operation?

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related