smcvey / tcz

The Chatting Zone Mud Server
GNU General Public License v2.0
6 stars 3 forks source link

Updated numerical array sorting to support negative numbers and also expanded to supporting floating point numbers #13

Closed noahmanderson closed 4 years ago

noahmanderson commented 4 years ago

Tested elements that are only numbers and also elements that have mixture of alphabetical and numerical elements. Some examples of arrays sorted ascending and descending:

@sort #43 = alpha descending elements 1 ";" Elements of dynamic array Test.sort.array2[14](#43 D) sorted into descending alphabetical order. [1:57.10 am]-> ex #43

Test.sort.array2[14](#43 D) Type: Dynamic array; Building Quota used: 15. Owner: Spite(#9 PWBPaybM). Flags: None. Size: 837 bytes (646 bytes compressed (22.8%))

[#14] words;5.00;wordstuff [#12] words;5.01;wordstuff [#1] otherwords;-5;wordstuff [#2] otherwords;-4;wordstuff [#3] otherwords;-3;wordstuff [#4] otherwords;-2;wordstuff [#5] otherwords;-1;wordstuff [#6] otherwords;0;wordstuff [#7] otherwords;1;wordstuff [#8] otherwords;2;wordstuff [#9] otherwords;3;wordstuff [#10] otherwords;4;wordstuff [#11] otherwords;5;wordstuff [#13] morewords;0.1;some words

@sort #43 = numerical ascending elements 2 ";" Elements of dynamic array Test.sort.array2[15](#43 D) sorted into ascending numerical order. [2:00.03 am]-> ex #43

Test.sort.array2[15](#43 D) Type: Dynamic array; Building Quota used: 16. Owner: Spite(#9 PWBPaybM). Flags: None. Size: 881 bytes (690 bytes compressed (21.7%))

[#1] otherwords;-5;wordstuff [#2] otherwords;-4;wordstuff [#3] otherwords;-3;wordstuff [#4] otherwords;-2;wordstuff [#15] abc;-1.5;evenly [#5] otherwords;-1;wordstuff [#6] otherwords;0;wordstuff [#13] morewords;0.1;some words [#7] otherwords;1;wordstuff [#8] otherwords;2;wordstuff [#9] otherwords;3;wordstuff [#10] otherwords;4;wordstuff [#14] words;5.00;wordstuff [#11] otherwords;5;wordstuff [#12] words;5.01;wordstuff

@sort #43 = numerical ascending elements 2 ";" Elements of dynamic array Test.sort.array2[15](#43 D) sorted into ascending numerical order. [2:00.03 am]-> ex #43

Test.sort.array2[15](#43 D) Type: Dynamic array; Building Quota used: 16. Owner: Spite(#9 PWBPaybM). Flags: None. Size: 881 bytes (690 bytes compressed (21.7%))

[#1] otherwords;-5;wordstuff [#2] otherwords;-4;wordstuff [#3] otherwords;-3;wordstuff [#4] otherwords;-2;wordstuff [#15] abc;-1.5;evenly [#5] otherwords;-1;wordstuff [#6] otherwords;0;wordstuff [#13] morewords;0.1;some words [#7] otherwords;1;wordstuff [#8] otherwords;2;wordstuff [#9] otherwords;3;wordstuff [#10] otherwords;4;wordstuff [#14] words;5.00;wordstuff [#11] otherwords;5;wordstuff [#12] words;5.01;wordstuff