Hello,

I just make this abstraction : [list-unique-random] to get a list with
random numbers (integers).
I didn't see it in the list-abs or in sfruit (am i wrong ?).

You can determine :
- the range of the random number with an argument or dynamically.
- the size wanted of you list with a message.

Maybe, this is not an optimized abstraction, so people can modify it.
Frank, if you want, you can modify it (my english is not very good) and
add it to list-abs.
++

Jack


#N canvas 594 38 670 490 10;
#X msg 111 106 100;
#X obj 111 272 list-unique-random 100;
#X obj 111 351 list-sort;
#X msg 134 166 101;
#X text 170 167 <- error : 101 > 100;
#X floatatom 52 142 5 0 0 0 - - -;
#X obj 131 305 print unique-random;
#X obj 111 385 print ordered-list;
#X msg 240 218 50;
#X text 180 351 <- sort the list from [list-unique-random];
#X text 144 105 <- list length wanted (this number must be equal or
lower than the range of the random number);
#X text 256 271 <- the first argument is the range of the random number
;
#X text 274 218 <- you can set dynamically the range of the random
number;
#X text 514 378 Jack/RYBN 2010;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 1 0 6 0;
#X connect 2 0 7 0;
#X connect 3 0 1 0;
#X connect 5 0 1 0;
#X connect 8 0 1 1;
#N canvas 99 101 675 621 10;
#X obj 137 166 until;
#X obj 168 248 list;
#X msg 203 167 -1;
#X obj 168 308 ==;
#X obj 137 431 spigot;
#X obj 168 335 +;
#X obj 198 335 t f;
#X msg 200 309 0;
#X obj 152 360 f;
#X obj 211 247 list;
#X obj 243 247 t l;
#X obj 152 384 == 0;
#X obj 137 218 t f b b f b;
#X obj 199 431 spigot;
#X obj 199 456 b;
#X obj 232 384 != 0;
#X obj 137 486 list;
#X obj 118 143 t b f b;
#X obj 167 486 t l;
#X obj 118 518 list;
#X obj 168 273 list-drip;
#X obj 118 542 outlet;
#X obj 79 21 inlet;
#X obj 118 71 - 1;
#X obj 118 121 + 1;
#X obj 261 147 print error;
#X obj 118 95 moses \$1;
#X obj 137 190 random \$1;
#X text 355 527 Jack/RYBN 2010;
#X obj 188 49 inlet;
#X obj 79 45 moses 1;
#X msg 261 112 the list length must be equal or lower than the range
of the random number;
#X connect 0 0 27 0;
#X connect 1 0 20 0;
#X connect 2 0 1 1;
#X connect 3 0 5 0;
#X connect 4 0 9 0;
#X connect 4 0 16 0;
#X connect 5 0 6 0;
#X connect 5 0 8 1;
#X connect 6 0 5 1;
#X connect 7 0 5 1;
#X connect 8 0 11 0;
#X connect 8 0 15 0;
#X connect 9 0 10 0;
#X connect 9 0 1 1;
#X connect 10 0 9 1;
#X connect 11 0 4 1;
#X connect 12 0 4 0;
#X connect 12 0 13 0;
#X connect 12 1 8 0;
#X connect 12 2 1 0;
#X connect 12 3 3 1;
#X connect 12 4 7 0;
#X connect 13 0 14 0;
#X connect 14 0 27 0;
#X connect 15 0 13 1;
#X connect 16 0 18 0;
#X connect 16 0 19 1;
#X connect 17 0 19 0;
#X connect 17 1 0 0;
#X connect 17 2 2 0;
#X connect 17 2 9 1;
#X connect 17 2 16 1;
#X connect 18 0 16 1;
#X connect 19 0 21 0;
#X connect 20 0 3 0;
#X connect 22 0 30 0;
#X connect 23 0 26 0;
#X connect 24 0 17 0;
#X connect 26 0 24 0;
#X connect 26 1 31 0;
#X connect 27 0 12 0;
#X connect 29 0 26 1;
#X connect 29 0 27 1;
#X connect 30 1 23 0;
#X connect 31 0 25 0;
_______________________________________________
[email protected] mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list

Reply via email to