msg00074.html

1999Q4/msg00074.html · 7.3 KB

From the archive 1999Q4.zip

Download the archive   « Back to the archive contents

<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev] Algorithms for an Infinite Universe -->
<!--X-From-R13: Ayn Tbfurvz =?vfb&#45;8859&#45;1?C?Ue=T8fgnq?= <byntNvsv.hvb.ab> -->
<!--X-Date: Fri, 15 Oct 1999 12:20:32 &#45;0700 -->
<!--X-Message-Id: 38078824.8DAE9BED#ifi,uio.no -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 37E5560B.4B59342F#ifi,uio.no -->
<!--X-Reference: 19991011101742.42680.qmail#hotmail,com -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev] Algorithms for an Infinite Universe</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:olag#ifi,uio.no">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00072.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00073.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00040.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00073.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00074">Author</A>
&nbsp;|&nbsp;<A HREF="#00074">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00074">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev] Algorithms for an Infinite Universe</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Subject</em>: Re: [MUD-Dev] Algorithms for an Infinite Universe</LI>
<LI><em>From</em>: Ola Fosheim Grøstad &lt;<A HREF="mailto:olag#ifi,uio.no">olag#ifi,uio.no</A>&gt;</LI>
<LI><em>Date</em>: Fri, 15 Oct 1999 21:01:40 +0100</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Sender</em>: <A HREF="mailto:mud-dev-admin#kanga,nu">mud-dev-admin#kanga,nu</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
Quzah wrote:
&gt; Is it just me, or is this guy totally, 100% wrong? I've
&gt; tried both by following his explanation, and by just taking
&gt; his code, to get his pesudo-random number generator to
&gt; work, and it doesn't. He's wrong.

Ack... I only skimmed the article. Hoped it would stimulate some discussion
on the topic, not this kind of discussion though. :(

&gt; A quick copy-paste into a text file and his pseudo-random
&gt; generator returns all zeros for the random numbers. Sad.

Yes. Very sad, but replace Max with a prime (2039 for example) and it may
work.  Random generators are not my speciality, but here are some examples
that ought to work without too much pain (haven't tried it in five years,
but...):

#define RND_A 16807
#define RND_M 2147483647
#define RND_Q 127773
#define RND_R 2836
/* RND_Q = M DIV A  RND_R = M MOD A */

long rnd_seed;

long random(){
    long tmp_seed;
    tmp_seed = RND_A * (rnd_seed % RND_Q) - RND_R*(rnd_seed/RND_Q);
    rnd_seed = (tmp_seed &gt;= 0 ? tmp_seed : tmp_seed + RND_M);
    return rnd_seed;
}

/** a simple random for 16 bit mod ***/

unsigned short frnd_seed;
unsigned short frnd_a;
#define FRND_A 17
#define FRND_M 65521

unsigned short fastrandom(){
    return frnd_seed = (unsigned short)(((unsigned long)FRND_A *frnd_seed)
                       % (unsigned short)FRND_M);
}

--
Ola




_______________________________________________
MUD-Dev maillist  -  MUD-Dev#kanga,nu
<A  HREF="http://www.kanga.nu/lists/listinfo/mud-dev">http://www.kanga.nu/lists/listinfo/mud-dev</A>

</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00029" HREF="msg00029.html">Re: [MUD-Dev] Algorithms for an Infinite Universe</A></STRONG>
<UL><LI><EM>From:</EM> "Quzah" &lt;quzah#hotmail,com&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00072.html">RE: [MUD-Dev] patents and muds</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00073.html">Re: [MUD-Dev] Algorithms for an Infinite Universe</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00040.html">Re: [MUD-Dev] Algorithms for an Infinite Universe</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00073.html">Re: [MUD-Dev] Algorithms for an Infinite Universe</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00074"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00074"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>Re: [MUD-Dev] weather</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<ul compact>
<LI><strong><A NAME="00103" HREF="msg00103.html">Re: [MUD-Dev] weather</A></strong>, 
Greg Miller <a href="mailto:gmiller#classic-games,com">gmiller#classic-games,com</a>, Tue 02 Nov 1999, 18:35 GMT
</LI>
</ul>
</ul>
</ul>
</LI>
<LI><strong><A NAME="00029" HREF="msg00029.html">Re: [MUD-Dev] Algorithms for an Infinite Universe</A></strong>, 
Quzah <a href="mailto:quzah#hotmail,com">quzah#hotmail,com</a>, Mon 11 Oct 1999, 17:36 GMT
<UL>
<LI><strong><A NAME="00038" HREF="msg00038.html">Re: [MUD-Dev] Algorithms for an Infinite Universe</A></strong>, 
Jp Calderone <a href="mailto:exarkun#flashmail,com">exarkun#flashmail,com</a>, Mon 11 Oct 1999, 21:29 GMT
<UL>
<LI><strong><A NAME="00040" HREF="msg00040.html">Re: [MUD-Dev] Algorithms for an Infinite Universe</A></strong>, 
Joel Kelso <a href="mailto:joel#ee,uwa.edu.au">joel#ee,uwa.edu.au</a>, Tue 12 Oct 1999, 02:28 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00074" HREF="msg00074.html">Re: [MUD-Dev] Algorithms for an Infinite Universe</A></strong>, 
Ola Fosheim Grøstad <a href="mailto:olag#ifi,uio.no">olag#ifi,uio.no</a>, Fri 15 Oct 1999, 19:20 GMT
</LI>
<LI><strong><A NAME="00073" HREF="msg00073.html">Re: [MUD-Dev] Algorithms for an Infinite Universe</A></strong>, 
Ola Fosheim Grøstad <a href="mailto:olag#ifi,uio.no">olag#ifi,uio.no</a>, Fri 15 Oct 1999, 19:20 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00030" HREF="msg00030.html">[MUD-Dev] Skill Power vs Skill Rarity</A></strong>, 
Philip Loguinov -- Draymoor <a href="mailto:fibhufky#erols,com">fibhufky#erols,com</a>, Mon 11 Oct 1999, 17:36 GMT
<UL>
<LI><strong><A NAME="00035" HREF="msg00035.html">Re: [MUD-Dev] Skill Power vs Skill Rarity</A></strong>, 
Mik Clarke <a href="mailto:mikclrk#attglobal,net">mikclrk#attglobal,net</a>, Mon 11 Oct 1999, 21:29 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00031" HREF="msg00031.html">[MUD-Dev] Alternate Character Sets (Telnet Question)</A></strong>, 
Chimera <a href="mailto:chimera#SoftHome,net">chimera#SoftHome,net</a>, Mon 11 Oct 1999, 17:36 GMT
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>

Site Stats

Snippets: 1791
Codebases: 571