Newsgroups: comp.os.msdos.djgpp From: tob AT world DOT std DOT com Subject: Re: Allegro ex11.c Message-ID: Sender: tob AT world DOT std DOT com (Tom Breton) Reply-To: tob AT world DOT std DOT com Organization: BREnterprises References: <34DF7294 DOT 21D0 AT home DOT com> Date: Tue, 10 Feb 1998 04:36:01 GMT Lines: 16 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Dan writes: > hotspot[c] += (random() & 7) - 3; > > what does "random() & 7" do? Strips out all but the lowest 3 bits. The idiom is familiar to most C and C++ programmers. It might have been more transparently written: hotspot[c] += (random() % 8) - 3; Tom -- When you see a spam, just remember that a spammer is some fool who just can't believe that if they bother a million people, they'll get fewer than a dozen interested responses. (Copy this so more wannabe spammers see it)