[Tutor] fake defrag revisited

Wayne Werner waynejwerner at gmail.com
Wed Oct 5 15:50:36 CEST 2011


On Wed, Oct 5, 2011 at 8:18 AM, Dave Angel <d at davea.name> wrote:

> Anyway, you can slow it down drastically by alternating bubble passes with
> random passes, where in each case a random pair is swapped if they're out of
> order.
>

You can also slow it down by adding a time.sleep(1) (sleeps for 1 second).
Use 0.1 for a tenth if one second is too slow. Or
time.sleep(random.random()) if you want a variable (0-1 second) sleep time.

HTH,
Wayne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20111005/f156b09c/attachment.html>


More information about the Tutor mailing list