aboutsummaryrefslogtreecommitdiff
path: root/examples/sort.pd
blob: b6d80a428403075c6133b0779a54e951167bb756 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#N canvas 137 350 811 532 10;
#X obj 95 233 print UNSORTED;
#X msg 37 107 bang;
#X obj 198 23 sort;
#X text 314 87 any package-elements that are non-float will be interpreted
as "0.0".;
#X text 270 87 note :;
#X obj 56 335 sort 1;
#X obj 56 467 print ASCENDING;
#X obj 37 377 sort -1;
#X obj 37 487 print DESCENDING;
#X text 278 297 creation : "sort [<dir>]";
#X text 457 310 dir < 0 :: descending sort;
#X text 456 297 dir >= 0 :: ascending sort;
#X text 460 328 dir defaults to ascending;
#N canvas 360 175 475 254 randompackage 0;
#X obj 37 190 pack 0 0 0 0 0 0 0 0 0 0 0;
#X obj 170 87 random 15;
#X obj 156 104 random 15;
#X obj 143 121 random 15;
#X obj 130 138 random 15;
#X obj 116 155 random 15;
#X obj 103 172 random 15;
#X obj 90 87 random 15;
#X obj 76 104 random 15;
#X obj 63 121 random 15;
#X obj 50 138 random 15;
#X obj 37 155 random 15;
#X obj 37 52 inlet;
#X obj 37 69 t b b b b b b b b b b b;
#X obj 37 210 outlet;
#X connect 0 0 14 0;
#X connect 1 0 0 10;
#X connect 2 0 0 9;
#X connect 3 0 0 8;
#X connect 4 0 0 7;
#X connect 5 0 0 6;
#X connect 6 0 0 5;
#X connect 7 0 0 4;
#X connect 8 0 0 3;
#X connect 9 0 0 2;
#X connect 10 0 0 1;
#X connect 11 0 0 0;
#X connect 12 0 13 0;
#X connect 13 0 11 0;
#X connect 13 1 10 0;
#X connect 13 2 9 0;
#X connect 13 3 8 0;
#X connect 13 4 7 0;
#X connect 13 5 6 0;
#X connect 13 6 5 0;
#X connect 13 7 4 0;
#X connect 13 8 3 0;
#X connect 13 9 2 0;
#X connect 13 10 1 0;
#X restore 37 195 pd randompackage;
#X msg 72 160 -----;
#X obj 37 141 t b b;
#X floatatom 94 268 0 0 0 0 - - -;
#X text 128 270 direction;
#X obj 37 213 t l l l l;
#X obj 75 287 sort;
#X obj 75 448 print SORTED;
#X text 237 23 shell-sort a package of floats;
#X text 553 16 part of zexy;
#X obj 81 402 print indicesD;
#X obj 93 357 print indicesA;
#X obj 72 177 print -----;
#X text 269 162 the second outlet gives the indices of the input data.
;
#X connect 1 0 15 0;
#X connect 5 0 6 0;
#X connect 5 1 24 0;
#X connect 7 0 8 0;
#X connect 7 1 23 0;
#X connect 13 0 18 0;
#X connect 14 0 25 0;
#X connect 15 0 13 0;
#X connect 15 1 14 0;
#X connect 16 0 19 1;
#X connect 18 0 7 0;
#X connect 18 1 5 0;
#X connect 18 2 19 0;
#X connect 18 3 0 0;
#X connect 19 0 20 0;