[A83] Re: Randomization


[Prev][Next][Index][Thread]

[A83] Re: Randomization




If I were to use random numbers I would probably uses the Rand rom call.
To make a semi-random seed in TI-Basic, I would put the calculator in a
getkey loop and count up until the user presses a key. The variable that
was counting is then stored in the seed, and a call to randInt( will
yield a semi-random result. Maybe using this technique along with the
'r' register, one could come up with an even more random piece of code.
It is helpful to put the getkey loop at, say, the title screen, so the
user does not even notice it.

Thomas Lutz

Stevens I.T.

-----Original Message-----
From: assembly-83-bounce@lists.ticalc.org
[mailto:assembly-83-bounce@lists.ticalc.org] On Behalf Of Wouter v.d.
Put
Sent: Thursday, December 13, 2001 8:42 AM
To: assembly-83@lists.ticalc.org
Subject: [A83] Re: Randomization



In Q(uick)Basic you could use:

RANDOMIZE TIMER

it uses the timer (wich is just a 'random' number at the time you use
the=20
program) as seed.

>From: Burak "G=FCl" <eniyi@yahoo.com>
>Reply-To: assembly-83@lists.ticalc.org
>To: assembly-83@lists.ticalc.org
>Subject: [A83] Re: Randomization
>Date: Tue, 11 Dec 2001 10:30:30 -0800 (PST)
>MIME-Version: 1.0
>Received: from [195.67.128.9] by hotmail.com (3.2) with ESMTP id=20
>MHotMailBDDF9BCD009A400438A2C34380090E370; Tue, 11 Dec 2001 10:30:46
-0800
>Received: from towerguard. (mx-1.sollentuna.net [195.67.128.9])by=20
>mx-1.sollentuna.net (Postfix) with ESMTPid A25B418013; Tue, 11 Dec 2001

>19:30:33 +0100 (CET)
>Received: with LISTAR (v1.0.0; list assembly-83); Tue, 11 Dec 2001
19:30:33=20
>+0100 (CET)
>Received: from web13805.mail.yahoo.com (web13805.mail.yahoo.com=20
>[216.136.175.15])by mx-1.sollentuna.net (Postfix) with SMTP id=20
>B593618010for <assembly-83@lists.ticalc.org>; Tue, 11 Dec 2001 19:30:31

>+0100 (CET)
>Received: from [195.87.200.194] by web13805.mail.yahoo.com via HTTP;
Tue,=20
>11 Dec 2001 10:30:30 PST
>From assembly-83-bounce@lists.ticalc.org Tue, 11 Dec 2001 10:32:08
-0800
>Delivered-To: lists.ticalc-assembly-83@mx-1.sollentuna.net
>Message-ID: <20011211183030.66504.qmail@web13805.mail.yahoo.com>
>In-Reply-To: <001001c1825c$ba7fbbe0$0201a8c0@brinstar>
>X-listar-version: Listar v1.0.0
>Sender: assembly-83-bounce@lists.ticalc.org
>Errors-To: assembly-83-bounce@lists.ticalc.org
>X-original-sender: eniyi@yahoo.com
>Precedence: bulk
>X-list: assembly-83
>
>
>The calculator's generator is always giving the same results when I use
>randInt( and I don't like to use it.
>I remember writing a simple slot machine in Qbasic seven years ago. The
>player inputs a number before running the slot machine. It seemed me
silly
>at that time, but now I understand it better. It was the same reason.
>
>--- David Phillips <david@acz.org> wrote:
> > You need something that will change.  For example, you might display
a
> > title
> > screen when a program starts.  Start a timer when the screen is
> > displayed,
> > and note how long it takes for the user to press a key.  This value
can
> > be
> > used as the starting seed value for the random number generator.
>
>=3D=3D=3D=3D=3D
>I'm a moderator of http://www.ti-programmers.com forum.
>Brain: an apparatus with which we think we think.
>Beyin: onu kullanarak d=FC=FE=FCnd=FC=F0=FCm=FCz=FC =
d=FC=FE=FCnd=FC=F0=FCm=FCz bir alet.
>=A0 -Ambrose Bierce
>
>
>__________________________________________________
>Do You Yahoo!?
>Check out Yahoo! Shopping and Yahoo! Auctions for all of
>your unique holiday gifts! Buy at http://shopping.yahoo.com
>or bid at http://auctions.yahoo.com
>
>


_________________________________________________________________
Download MSN Explorer gratis van http://explorer.msn.nl/intl.asp.








Follow-Ups: References: