<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/955" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2002-02-01T22:39:00-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/955</id>

		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2002-02-01T22:39:00-04:00</updated>

		<published>2002-02-01T22:39:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=4257#p4257</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=4257#p4257"/>
		<title type="html"><![CDATA[randomizing a list]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=4257#p4257"><![CDATA[
List on input, returns randomized list:<br><div class="codebox"><p>Code: </p><pre><code>proc randlist { list } {   # determine length of list   set listlength [llength $list]   # iterate on list, decrease length per iteration    for { set i $listlength } { $i &gt; 1 } { incr i -1 } {      # choose random index       set randindex [rand $i]      # pick the random item      set randitem [lindex $list $randindex]      # cut the random item from the list      set list [lreplace $list $randindex $randindex]      # paste the random item at the end of the list      set list [lappend list $randitem]   }   return $list}</code></pre></div>To test the code from the partyline:<br><div class="codebox"><p>Code: </p><pre><code>bind dcc - randlist makerandlistproc makerandlist { handle idx arg } {   set list "1 2 3 4 5 6 7 8 9 10"   putlog [randlist $list]}</code></pre></div>&lt;font size=-1&gt;[ This Message was edited by: egghead on 2002-02-01 20:04 ]&lt;/font&gt;<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Fri Feb 01, 2002 10:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-01-31T08:21:00-04:00</updated>

		<published>2002-01-31T08:21:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=4229#p4229</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=4229#p4229"/>
		<title type="html"><![CDATA[randomizing a list]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=4229#p4229"><![CDATA[
one can sort a list using the lsort command, is there a way to randomize the list... or a method of using the lsort -command option to randomize it??<br><br>thanks<p>Statistics: Posted by Guest — Thu Jan 31, 2002 8:21 am</p><hr />
]]></content>
	</entry>
	</feed>
