randome no duplicates.

    Jan 05 2014 | 4:05 pm
    hi there everyone. i need to create a random object that puts out 10 integers between 1 and 26 without repeating any.
    basically right now i have a bang into an {uzi 10} then into a {random 25} then into a {+ 1} then into {zl.group 10} then to a {message}
    this eliminates 0 and puts out numbers between 1 and 26
    there are repeats in the numbers which makes this useless for what i need it for. can anyone help me get a string of 10 RANDOM numbers without any repeats?
    many thanks in advance

    • Jan 05 2014 | 4:14 pm
      If you look at the help file for [random], there is a list of "See Also" objects. I find this list to be incredibly useful when I'm looking for a particular function, but can't think of the name of an object. Check out the object [urn], it does what you want.
    • Jan 05 2014 | 5:34 pm
      im not sure urn will do what i want.
      ----------------DESCRIPTION------------------------------ urn
      Generate random numbers without duplicates
      outputs random numbers and keeps track of each number that has been generated When all numbers up to the maximum (set via an argument or the right inlet) have been output, a bang is sent out the right outlet.
      it seems like it sort of counts up to the maximum by randomly outputting values ore something. i have tried various combinations of this and i just cant see how it will work. can someone explain how i would go about this with "urn" ? or if not how else i can reach my goal?
      many thanks
    • Jan 05 2014 | 6:07 pm
      Send clear to urn after you generate your 10 unique integers.
    • Jan 05 2014 | 6:12 pm
      you would just replace 'random 25' with 'urn 25' and you could use the uzi finished bang to send a clear message to urn so you don't run out of numbers - once urn has output all the numbers in the range you select it stops outputting until you send 'clear'. Maybe this is what is confusing to you?