From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/68987 Path: news.gmane.org!not-for-mail From: Otared Kavian Newsgroups: gmane.comp.tex.context Subject: Random selection of a word in a set with lua and mkiv Date: Wed, 8 Jun 2011 18:52:36 +0200 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1307551999 11713 80.91.229.12 (8 Jun 2011 16:53:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 8 Jun 2011 16:53:19 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Jun 08 18:53:15 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QUM0I-0001s9-QA for gctc-ntg-context-518@m.gmane.org; Wed, 08 Jun 2011 18:53:14 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id AA316CAD8E; Wed, 8 Jun 2011 18:53:13 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id S8tYaJh4CN0p; Wed, 8 Jun 2011 18:53:11 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E8FDCCAD7D; Wed, 8 Jun 2011 18:53:10 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B6309CAD7D for ; Wed, 8 Jun 2011 18:53:09 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id sC0mT2yZ8bDT for ; Wed, 8 Jun 2011 18:52:58 +0200 (CEST) Original-Received: from filter3-til.mf.surf.net (filter3-til.mf.surf.net [194.171.167.219]) by balder.ntg.nl (Postfix) with ESMTP id E5FA6CAD39 for ; Wed, 8 Jun 2011 18:52:57 +0200 (CEST) Original-Received: from mail-wy0-f169.google.com (mail-wy0-f169.google.com [74.125.82.169]) by filter3-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p58GqveZ028551 for ; Wed, 8 Jun 2011 18:52:57 +0200 Original-Received: by wyf19 with SMTP id 19so664292wyf.14 for ; Wed, 08 Jun 2011 09:52:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:content-type:content-transfer-encoding :subject:date:message-id:to:mime-version:x-mailer; bh=+s69ACpRftmpQpcqKxgXTC556zuBgnktdilOm/LIddM=; b=lfZMs6rZ8xJOSQ0AlAvGzPErkraGZpcIf/VbCGZW1eZVR/Lj7cTTAzFm51e4BjOlO8 F3KGxK2fvpW6YKegeES7IvK45OFAHn4tQxcdlY3DsdbCKGicXaZ5iuveXdVlSTpx2ZCh 7iK3ZGBDT7fZUJhTxAZe5z8q1qvHjxF12RGw4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:content-type:content-transfer-encoding:subject:date:message-id :to:mime-version:x-mailer; b=H9XhAwnBQPig9H+xp8fQxR4XrCAFwOdUXB1WLNqSovUzX+OpQ8wLqV46tJqj88Nv5U y34AbK/UHIoAiIgCni7hRLM92kbSd9IckVK2efMlqsuVi+mwTb/qzQ5W3Rys0e8/IosD +nIpASoMRN2oHc+vkOefmlVX4rX7iOXCzCbxU= Original-Received: by 10.216.209.212 with SMTP id s62mr3654840weo.67.1307551959132; Wed, 08 Jun 2011 09:52:39 -0700 (PDT) Original-Received: from [192.168.1.29] (118.24.85.79.rev.sfr.net [79.85.24.118]) by mx.google.com with ESMTPS id z22sm389438weq.2.2011.06.08.09.52.37 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 08 Jun 2011 09:52:38 -0700 (PDT) X-Mailer: Apple Mail (2.1084) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=74.125.82.169; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0eERsQVpE - 4ba55cd2b508 - 20110608 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.219 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:68987 Archived-At: Hi all, Assuming that we have a set of words or expressions, say {Maths, Physics, Algebra, Analysis, Chemistry, Geometry, Wave equation, Sc= hr=F6dinger equation} is it possible to write a lua function, named for instance randomselectword which returns one of the words or expressions selected at random in the abo= ve set? Indeed this is intended to be used in a TeX file processed with mkiv. Thanks in advance for any idea and help. Best regards: OK ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________