www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/23/06:35:17

From: Nicolas Blais <alphaqt AT phreaker DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: random under djgpp
Date: Fri, 23 Oct 1998 07:28:21 -0400
Organization: Alpha Quark Technologie
Lines: 20
Message-ID: <36306854.93ACE66A@phreaker.net>
References: <70osqi$49k$1 AT news DOT kren DOT nm DOT kr>
NNTP-Posting-Host: ts1-40.f2001.quebectel.com
Mime-Version: 1.0
X-Mailer: Mozilla 4.5b2 [en] (Win95; I)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
You first have to randomize the numbers, or else you will always have the
same.
<BR>srandom(time(NULL));
<BR>int x = (random() % 260)+ 1;
<P>This is an example of getting a number between 1 and 260.&nbsp; The
srandom acts like the RANDOMIZE in Basic.&nbsp; It's seed is time so always
changes.
<P>Nicolas Blais
<P>big choi wrote:
<BLOCKQUOTE TYPE=CITE>Hi
<BR>i don't know..get random number..
<BR>i write "int x=random(260)" under turbo c..
<BR>i'd like to get between 0 and 260..
<BR>help me plz.. what to write.. under djgpp??
<BR>email supercms AT netian DOT com
<BR>thanks..</BLOCKQUOTE>
</HTML>

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019