Xref: utzoo comp.sources.wanted:14529 alt.sources.d:1192 rec.games.misc:12885 rec.games.programmer:2713 Path: utzoo!utgpu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!dali.cs.montana.edu!ogicse!intelhf!ichips!inews!pinkas From: pinkas@st860.intel.com (Israel Pinkas) Newsgroups: comp.sources.wanted,alt.sources.d,rec.games.misc,rec.games.programmer Subject: Re: Maze generation Message-ID: Date: 18 Dec 90 01:48:17 GMT References: <1215@syacus.acus.oz> <1990Dec13.190759.9297@craycos.com> <1990Dec15.093542.2725@pegasus.com> Sender: news@inews.intel.com Organization: Software Technologies, INTeL Corporation, Santa Clara, CA Lines: 30 In-reply-to: tleylan@pegasus.com's message of 15 Dec 90 09:35:42 GMT In article <1990Dec15.093542.2725@pegasus.com> tleylan@pegasus.com (Tom Leylan) writes: > Scott... it looked so cute that I tried it but no maze. It printed a > repeated pattern though. Made me suspect that the RAND() function might > be operating differently. I'm using Microsoft C and it returns a random > value between 1 and 32767. Does this appear to conflict with anything ? Yep, that's the problem. The BSD version of rand() returns a number between 0 and 2^31-1, whereas the System V and DOS versions return a number between 0 and 2^15-1. Since the return value is compared against 6<<27, the test always fails on DOS and SysV machines. Change the 27 on the last line to 11 and you should get better results. > BTW, if I was forced to guess it's origins it "looks" like an entry in > the obfuscated code contest that someone holds each year. I believe that it is from the 1989 contest. -Israel Pinkas -- -------------------------------------- Disclaimer: The above are my personal opinions, and in no way represent the opinions of Intel Corporation. In no way should the above be taken to be a statement of Intel. UUCP: {amdcad,decwrl,hplabs,oliveb,pur-ee,qantel}!intelca!mipos3!st860!pinkas ARPA: pinkas%st860.intel.com@relay.cs.net CSNET: pinkas@st860.intel.com