annotate samples/sort.tp @ 347:ff7ea11b4b60

Add length method to executable bytearrays
author Michael Pavone <pavone@retrodev.com>
date Fri, 10 Apr 2015 00:48:12 -0700
parents fb54a3af9c86
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
322
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1 #{
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2 main <- {
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3 a <- #[1 2 3 4 5 6 7 8 9]
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4 b <- #[9 8 7 6 5 4 3 2 1]
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5 c <- #[1 3 5 7 9 2 4 6 8 10]
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6 d <- #[10 8 6 4 2 9 7 5 3 1]
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7 a sort
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
8 print: (a join: " ") . "\n"
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
9 b sort
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
10 print: (b join: " ") . "\n"
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
11 c sort
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
12 print: (c join: " ") . "\n"
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
13 d sort
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
14 print: (d join: " ") . "\n"
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
15 }
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
16 }