Added amb466 - Random Sorting

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401923
This commit is contained in:
Matt Woodrow
2008-03-03 06:28:41 +00:00
parent 1f96e25121
commit 211b0159e5
3 changed files with 90 additions and 7 deletions
+1
View File
@@ -43,6 +43,7 @@ enum SortOrder
{
Sort_Ascending = 0, /**< Ascending order */
Sort_Descending = 1, /**< Descending order */
Sort_Random = 2 /**< Random order */
};
/**
+28 -4
View File
@@ -47,6 +47,10 @@ public Action:Command_TestSortInts(args)
SortIntegers(array, 10, Sort_Descending)
PrintIntegers(array, 10)
PrintToServer("Testing random sort:")
SortIntegers(array, 10, Sort_Random)
PrintIntegers(array, 10)
return Plugin_Handled
}
@@ -74,6 +78,10 @@ public Action:Command_TestSortFloats(args)
SortFloats(array, 10, Sort_Descending)
PrintFloats(array, 10)
PrintToServer("Testing random sort:")
SortFloats(array, 10, Sort_Random)
PrintFloats(array, 10)
return Plugin_Handled
}
@@ -125,7 +133,7 @@ public Action:Command_TestSortStrings(args)
"sidluke",
"johnny got his gun",
"gabe newell",
"hello",
"pRED*'s awesome",
"WHAT?!"
}
@@ -137,6 +145,10 @@ public Action:Command_TestSortStrings(args)
SortStrings(strarray, 10, Sort_Descending)
PrintStrings(strarray, 10)
PrintToServer("Testing random sort:")
SortStrings(strarray, 10, Sort_Random)
PrintStrings(strarray, 10)
return Plugin_Handled
}
@@ -157,7 +169,7 @@ public Action:Command_TestSort2D(args)
"sidluke",
"johnny got his gun",
"gabe newell",
"hello",
"pred is a crab",
"WHAT?!"
}
@@ -204,6 +216,10 @@ public Action:Command_TestSortADTInts(args)
SortADTArray(array, Sort_Descending, Sort_Integer)
PrintADTArrayIntegers(array)
PrintToServer("Testing random sort:")
SortADTArray(array, Sort_Random, Sort_Integer)
PrintADTArrayIntegers(array)
return Plugin_Handled
}
@@ -239,6 +255,10 @@ public Action:Command_TestSortADTFloats(args)
SortADTArray(array, Sort_Descending, Sort_Float)
PrintADTArrayFloats(array)
PrintToServer("Testing random sort:")
SortADTArray(array, Sort_Random, Sort_Float)
PrintADTArrayFloats(array)
return Plugin_Handled
}
@@ -264,7 +284,7 @@ public Action:Command_TestSortADTStrings(args)
PushArrayString(array, "sidluke");
PushArrayString(array, "johnny got his gun");
PushArrayString(array, "gabe newell");
PushArrayString(array, "hello");
PushArrayString(array, "Hello pRED*");
PushArrayString(array, "WHAT?!");
PrintToServer("Testing ascending sort:")
@@ -275,6 +295,10 @@ public Action:Command_TestSortADTStrings(args)
SortADTArray(array, Sort_Descending, Sort_String)
PrintADTArrayStrings(array)
PrintToServer("Testing random sort:")
SortADTArray(array, Sort_Random, Sort_String)
PrintADTArrayStrings(array)
return Plugin_Handled
}
@@ -298,7 +322,7 @@ public Action:Command_TestSortADTCustom(args)
PushArrayString(array, "sidluke");
PushArrayString(array, "johnny got his gun");
PushArrayString(array, "gabe newell");
PushArrayString(array, "hello");
PushArrayString(array, "pRED*'s running out of ideas");
PushArrayString(array, "WHAT?!");
PrintToServer("Testing custom sort:")