Page 1 of 1

Pseudorandom number generators

Posted: Fri Oct 26, 2007 5:46 am
by Quantum P.
prng.zip (6 KB)

So I was doodling a few days ago, generating pseudorandom numbers. You start with a row of random digits, and you calculate the digits for each successive row by adding the digits of the last row together (see here for details).

Anyway, I got tired of adding digits, so I decided to write a computer program to do the work for me. But then I thought, if I'm going to waste my time on something trivial, I might as well go all-out and do something crazy like implement it in ZZT. So here we are! I've been playing around with pseudorandom number generators in ZZT for the last few days, and I slapped together a file that demonstrates a few of the variants that I implemented.

I thought it might interest the programmer types around here, which is why I'm posting it. If nothing else, the first one draws pretty fractal-esque pictures! So download it.

Posted: Fri Oct 26, 2007 7:38 pm
by Microwave
(SPOILER)
Image

And that's what it does!

Posted: Fri Oct 26, 2007 10:10 pm
by Zandor 12
Pretty colors - I like it. :keen:

Posted: Fri Oct 26, 2007 10:38 pm
by zamros
it looks like a fleet of stealth bombers doing a raid on rainbowland

Posted: Fri Oct 26, 2007 11:15 pm
by Commodore
poor rainbow land. working things out randomly is a pain in zzt when you need to make a thing detect if blocked in direction or such. I almost make a working blackjack game but it got too complicated eventually. maybe i'll be able to do it if I try from scratch.

Posted: Sat Oct 27, 2007 12:07 am
by Dr. Dos
My idea of random is using a scroll and checking what color it is :(

Make a roguelike with this.

Posted: Sat Oct 27, 2007 9:42 pm
by Commodore
that's a good idea. saves a hell of a lot more space, the only real problem being you can't hide it. I forgot you can use colour with the "#if any" command.