ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Arthur Reutenauer <arthur.reutenauer@normalesup.org>
To: Mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: randomize
Date: Wed, 7 Apr 2010 13:05:33 +0200	[thread overview]
Message-ID: <20100407110533.GA28601@phare.normalesup.org> (raw)
In-Reply-To: <4BBC81EC.26955.5DF4DB@wwl.musensturm.de>

> Now it works. But WHY?

  Because that's the way random number generators works.  They're not
random at all, they generate completely predictable number sequences
from a "seed": each time you use the same seed, you get the exact same
sequence.  In your case, you used os.time() as a seed, which is an
integral number of seconds elapsed since some fixed date, and the fact
you saw the same number ten times simply means your code was ran ten
times within the same second.

	Arthur
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  reply	other threads:[~2010-04-07 11:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1.1270634402.10942.ntg-context@ntg.nl>
2010-04-07 11:00 ` randomize Wolfgang Werners-Lucchini
2010-04-07 11:05   ` Arthur Reutenauer [this message]
     [not found] <mailman.390.1270654736.4277.ntg-context@ntg.nl>
2010-04-08  7:28 ` randomize Wolfgang Werners-Lucchini
2010-04-08  7:41   ` randomize Arthur Reutenauer
2010-04-08  7:49     ` randomize Wolfgang Schuster
2010-04-08  8:00       ` randomize Arthur Reutenauer
     [not found] <mailman.376.1270641896.4277.ntg-context@ntg.nl>
2010-04-07 13:42 ` randomize Wolfgang Werners-Lucchini
2010-04-07 13:56   ` randomize Arthur Reutenauer
     [not found] <mailman.371.1270609971.4277.ntg-context@ntg.nl>
2010-04-07  9:40 ` randomize Wolfgang Werners-Lucchini
     [not found] <mailman.349.1270527943.4277.ntg-context@ntg.nl>
2010-04-06 23:10 ` randomize Wolfgang Werners-Lucchini
2010-04-07  6:58   ` randomize Wolfgang Schuster
2010-04-05 22:21 randomize Wolfgang Werners-Lucchini
2010-04-05 22:49 ` randomize Wolfgang Schuster
2010-04-07  3:05 ` randomize Aditya Mahajan
2010-04-07  7:17   ` randomize Hans Hagen
2010-04-07  7:45   ` randomize luigi scarso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100407110533.GA28601@phare.normalesup.org \
    --to=arthur.reutenauer@normalesup.org \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).