<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<?xml-stylesheet href="./_c74_ref.xsl" type="text/xsl"?>

<!--This is an automatically generated file. DO NOT EDIT THIS FILE DIRECTLY. Rather, use the _ref.xml files found in the 'edits' folder.-->
<c74object name="urn" module="max" category="Math">
	<digest>
		Generate random numbers without duplicates
	</digest>
	<description>
		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 <m>bang</m> is send out the right outlet.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Max
		</metadata>
		<metadata name="tag">
			Math
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				bang Generates Random Number
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
				Set Range of Random Numbers
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				Random Number Output
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="1" type="OUTLET_TYPE">
			<digest>
				bang If All Numbers in Range Chosen
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="limit" optional="1" type="int">
			<digest>
				Random number limit
			</digest>
			<description>
				The number of possible values for the random number generator. If no argument is typed in, there will be only <m>1</m> possible number. The maximum limit is 4096.
			</description>
		</objarg>
		<objarg name="seed" optional="1" type="int">
			<digest>
				Random generator seed
			</digest>
			<description>
				A second argument is used to set a &quot;seed&quot; value for the random generator. If no argument is specified, the time value will be used to initialize the seed.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Output random number
			</digest>
			<description>
				In left inlet: Sends out a previously unchosen random number from 0 to one less than the specified maximum limit.
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="limit" optional="0" type="int" />
			</arglist>
			<digest>
				Set random number limit
			</digest>
			<description>
				In right inlet: Clears the list of already chosen numbers, and specifies the number of possible values for the random number generator. The random numbers will range from 0 to one less than this maximum limit. The maximum limit is 4096.
			</description>
		</method>
		<method name="clear">
			<arglist />
			<digest>
				Clear the list of output numbers
			</digest>
			<description>
				In left inlet: Clears the list of already chosen numbers.
			</description>
		</method>
		<method name="in1">
			<arglist>
				<arg name="limit" optional="0" type="int" />
			</arglist>
			<digest>
				Set random number limit
			</digest>
			<description>
				Clears the list of already chosen numbers, and specifies the number of possible values for the random number generator. The random numbers will range from 0 to one less than this maximum limit. The maximum limit is 4096.
			</description>
		</method>
		<method name="seed">
			<arglist>
				<arg name="seed" optional="0" type="int" />
			</arglist>
			<digest>
				Seed the random generator
			</digest>
			<description>
				In left inlet: The word <m>seed</m>, followed by a number, provides a &quot;seed&quot; value for the random generator, which causes a specific (reproducible) sequence of pseudo-random numbers to occur. The number <m>0</m> uses the time elapsed since system startup (an unpredictable value) as the seed, ensuring an unpredictable sequence of numbers. This unpredictable seed is used by default when the <o>urn</o> object is created. However, once all numbers have been chosen, the sequence will repeat. Therefore, in order to achieve a non-repeating sequence of numbers, you will need to send the <o>urn</o> object the <m>seed 0</m> message each time you send it the <m>clear</m> message.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="urn.png" caption="Choose random numbers without repeating a choice" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="decide" />
		<seealso name="deferlow" />
		<seealso name="drunk" />
		<seealso name="random" />
	</seealsolist>
	<misc name="Output">
		<entry name="int">
			<description>
				Out left outlet: If there are numbers within the current range that have not been sent out since the last <m>clear</m> message was received, <o>urn</o> generates a random number between 0 and one less than the maximum.
			</description>
		</entry>
		<entry name="bang">
			<description>
				Out right outlet: When all numbers in the current range have been generated, <o>urn</o> sends a <m>bang</m> out the right outlet instead of a number out the left outlet.
			</description>
		</entry>
	</misc>
</c74object>
