mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-31 19:51:33 +00:00
16 lines
322 B
Text
16 lines
322 B
Text
end {
|
|
my_array = [2, 9, 10, 3, 1, 4, 5, 8, 7, 6];
|
|
|
|
print "Original:";
|
|
print my_array;
|
|
|
|
print;
|
|
print "Ascending:";
|
|
print sort(my_array);
|
|
print sort(my_array, func (a,b) { return a <=> b });
|
|
|
|
print;
|
|
print "Descending:";
|
|
print sort(my_array, "r");
|
|
print sort(my_array, func (a,b) { return b <=> a });
|
|
}
|