msg00073.html
1999Q4/msg00073.html · 7.1 KB
From the archive 1999Q4.zip
Download the archive « Back to the archive contents
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD-Dev] Algorithms for an Infinite Universe -->
<!--X-From-R13: Ayn Tbfurvz =?vfb-8859-1?C?Ue=T8fgnq?= <byntNvsv.hvb.ab> -->
<!--X-Date: Fri, 15 Oct 1999 12:20:34 -0700 -->
<!--X-Message-Id: 3804F62A.AB5EA767#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>
[ <a href="../">Other Periods</a>
| <a href="../../">Other mailing lists</a>
| <a href="/search.php3">Search</a>
]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->
Date:
[ <a href="msg00074.html">Previous</a>
| <a href="msg00075.html">Next</a>
]
Thread:
[ <a href="msg00074.html">Previous</a>
| <a href="msg00030.html">Next</a>
]
Index:
[ <A HREF="author.html#00073">Author</A>
| <A HREF="#00073">Date</A>
| <A HREF="thread.html#00073">Thread</A>
]
<!--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 <<A HREF="mailto:olag#ifi,uio.no">olag#ifi,uio.no</A>></LI>
<LI><em>Date</em>: Wed, 13 Oct 1999 22:14:18 +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:
> Is it just me, or is this guy totally, 100% wrong? I've
> tried both by following his explanation, and by just taking
> his code, to get his pesudo-random number generator to
> work, and it doesn't. He's wrong.
Ack... I only skimmed the article. Hoped it would generate some discussion,
not this kind of discussion though. :(
> A quick copy-paste into a text file and his pseudo-random
> generator returns all zeros for the random numbers. Sad.
Yeah, but replace Max with a prime (2039 for example) and it should work.
This random generator will hopefully work (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 >= 0 ? tmp_seed : tmp_seed + RND_M);
return rnd_seed;
}
/** if 16 bit mod is cheap ***/
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" <quzah#hotmail,com></LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00074.html">Re: [MUD-Dev] Algorithms for an Infinite Universe</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00075.html">RE: [MUD-Dev] patents and muds</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00074.html">Re: [MUD-Dev] Algorithms for an Infinite Universe</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00030.html">[MUD-Dev] Skill Power vs Skill Rarity</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00073"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00073"><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><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
<UL>
<LI><strong><A NAME="00032" HREF="msg00032.html">Re: [MUD-Dev] Alternate Character Sets (Telnet Question)</A></strong>,
Travis S. Casey <a href="mailto:efindel#io,com">efindel#io,com</a>, Mon 11 Oct 1999, 18:26 GMT
</LI>
</UL>
</LI>
</UL></BLOCKQUOTE>
</ul>
<hr>
<center>
[ <a href="../">Other Periods</a>
| <a href="../../">Other mailing lists</a>
| <a href="/search.php3">Search</a>
]
</center>
<hr>
</body>
</html>