Pseudorandom number generators

NOTE: I HATE A LOT OF YOUR ZZT GAMES, SO WATCH OUT!

Moderators: Commodore, Zenith Nadir

Post Reply
User avatar
Quantum P.
Level 17 Accordion Thief
Posts: 1433
Joined: Fri Sep 12, 2003 1:41 am
Location: Edmonds, WA
Contact:

Pseudorandom number generators

Post 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.
Microwave
hi
Posts: 114
Joined: Fri Aug 03, 2007 10:34 pm

Post by Microwave »

(SPOILER)
Image

And that's what it does!
User avatar
Zandor 12
What has science done???
Posts: 355
Joined: Wed Mar 12, 2003 5:19 am
Location: Neo Dakota
Contact:

Post by Zandor 12 »

Pretty colors - I like it. :keen:
User avatar
zamros
my power level is enormous
Posts: 543
Joined: Thu Mar 20, 2003 9:34 pm

Post by zamros »

it looks like a fleet of stealth bombers doing a raid on rainbowland
User avatar
Commodore
fgsdfs
Posts: 2471
Joined: Wed Mar 12, 2003 5:44 pm
Location: :noitacoL
Contact:

Post 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.
*POW* *CLANK* *PING*
User avatar
Dr. Dos
OH YES! USE VINE WHIP! <3
Posts: 1772
Joined: Tue Mar 11, 2003 12:00 am
Location: Washington

Post by Dr. Dos »

My idea of random is using a scroll and checking what color it is :(

Make a roguelike with this.
Visit the Museum of ZZT
Follow Worlds of ZZT on Twitter

Apologies for the old post you may have just read.
User avatar
Commodore
fgsdfs
Posts: 2471
Joined: Wed Mar 12, 2003 5:44 pm
Location: :noitacoL
Contact:

Post 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.
*POW* *CLANK* *PING*
Post Reply