comparison samples/sort.tp @ 322:fb54a3af9c86

Add sort method to arrays
author Michael Pavone <pavone@retrodev.com>
date Sun, 22 Mar 2015 22:06:50 -0700
parents
children
comparison
equal deleted inserted replaced
321:3edd0169311a 322:fb54a3af9c86
1 #{
2 main <- {
3 a <- #[1 2 3 4 5 6 7 8 9]
4 b <- #[9 8 7 6 5 4 3 2 1]
5 c <- #[1 3 5 7 9 2 4 6 8 10]
6 d <- #[10 8 6 4 2 9 7 5 3 1]
7 a sort
8 print: (a join: " ") . "\n"
9 b sort
10 print: (b join: " ") . "\n"
11 c sort
12 print: (c join: " ") . "\n"
13 d sort
14 print: (d join: " ") . "\n"
15 }
16 }