The NEW Build Your Own Arcade Controls

Main => Everything Else => Topic started by: DYNAGOD on December 03, 2005, 09:39:34 am

Title: interesting Pac fact
Post by: DYNAGOD on December 03, 2005, 09:39:34 am
1. The idea of the game came from
Title: Re: interesting Pac fact
Post by: quarterback on December 03, 2005, 10:54:10 am
4. The algorithm for only the orange ghost is
Title: Re: interesting Pac fact
Post by: Grasshopper on December 03, 2005, 11:00:51 am
I suppose it depends upon what is meant by "random" in this context.

A lot of programming languages have random number functions built in that are not truly random but are actually based on hard to predict series of numbers.
Title: Re: interesting Pac fact
Post by: brophog on December 05, 2005, 03:35:12 am
That's basically all random numbers. It's basically impossible to truly produce a random number, although some of today's programs get rather close.

Title: Re: interesting Pac fact
Post by: Bones on December 05, 2005, 05:19:14 am
That's basically all random numbers. It's basically impossible to truly produce a random number, although some of today's programs get rather close.
My old TI99/4A had a randomize statement. When this was put into the program it produced what appeared to be completely random results. Every time the program was run the numbers came out different.

Probably not truly random but as close to random as ---fudgesicle--- is to swearing.
Title: Re: interesting Pac fact
Post by: Ed_McCarron on December 05, 2005, 08:44:29 am
Randomize simply restarted the 'random' number generator from a known point, the 'seed'.  After that, it followed the same mathematical formula to create the numbers.

To get closer to random, programs used to:

A) Make a user press a key, and randomize based on the time it took.  Human reaction time was pretty random.

B) At the programs start, reseed the generator with the number of ticks the computer has been running.

Theres more, I'm sure.

God I'm a geek.  I got all nostalgic for my VIC-20 while thinking on this. :)
Title: Re: interesting Pac fact
Post by: Bones on December 05, 2005, 02:15:10 pm
The Randomize command could used without a seed, and the number appeared random. In other word the seed it then chose was random!
Title: Re: interesting Pac fact
Post by: Ed_McCarron on December 05, 2005, 03:33:51 pm
The Randomize command could used without a seed, and the number appeared random. In other word the seed it then chose was random!

I'm gonna go out on a limb and say no.

Even if it reseeded with a 'random' number, the function still held true and the sequence would be repeatable.  If you were to cold boot the computer and do this:

? RND(1)

You might get .34523

Turn off the computer, and do it again.  You'd get the same .34523 .

Now, do the same thing, but insert the randomize command in before the ? RND line.  I bet a dollar you get the same number both times.

Its rare I come down off my fence, you should consider this an honor.   ;D
Title: Re: interesting Pac fact
Post by: Stingray on December 05, 2005, 03:35:57 pm
I understood "fence".

-S
Title: Re: interesting Pac fact
Post by: Bones on December 05, 2005, 03:39:35 pm
The Randomize command could used without a seed, and the number appeared random. In other word the seed it then chose was random!

I'm gonna go out on a limb and say no.

Even if it reseeded with a 'random' number, the function still held true and the sequence would be repeatable.
Title: Re: interesting Pac fact
Post by: Stingray on December 05, 2005, 03:54:29 pm
Stingray loves mad science.

-S
Title: Re: interesting Pac fact
Post by: Ed_McCarron on December 05, 2005, 03:59:40 pm
Cool.

If it turns out I'm wrong (Won't be the first time) just tell me where to mail the $1 US.

You can convert it to flanian pobble beads or whatever currency is in vogue over there on your own. :)
Title: Re: interesting Pac fact
Post by: CIA_Guy on December 05, 2005, 09:42:17 pm
Some of the PC BASICs would use a frame count as the random number seed.  The seed was the number of frames displayed on the monitor since midnight -- effectively a random number used as a "starting point" for the random generator.

Title: Re: interesting Pac fact
Post by: Bones on December 05, 2005, 10:17:04 pm
Interesting... Would this also include output to TV screens?
Title: Re: interesting Pac fact
Post by: RayB on December 06, 2005, 12:54:03 am
I second the claim that the random command on some old computers produced the same sequence of numbers. My experience was primarily with the Commodore 64. I even discovered that if I plotted dots at supposedly random XY coordinates, over time a pattern of diagonal lines would emerge. The fact that any pattern at all would appear proves the numbers were not truly random, but following some sort of sequence.

I even used this discovery as the basis for a game I programmed called Wizard's Vault. The game had you control a wizard and you had to collect gold while walls were building themselves all around (randomly). Screenshot here:
(http://www.rayb.com/c64/Wizards_Vault_Game.gif)
As you can see from the partially built walls in that screenshot, even though I was only using Random to determine XY placement of each wall portion, they ended up forming diagonal lines!

If I ever wanted more truly random values, I used the system clock as the seed.
Title: Re: interesting Pac fact
Post by: Bones on December 06, 2005, 04:00:57 am
Results

REBOOT

>print rnd
.8225408469

>print rnd
.163164479

REBOOT

>print rnd
.8225408469

>print rnd
.163164479

REBOOT

>randomize
>print rnd
.7212480813

>print rnd
.0652526408

REBOOT

>randomize
>print rnd
.7759402018

>print rnd
.580351756

REBOOT

Randomize
>print rnd
.78060689

>print rnd
.9199114218


Certainly looks random!



Title: Re: interesting Pac fact
Post by: Ed_McCarron on December 06, 2005, 05:52:05 am
Great, now I must go commit ritual suicide by impaling myself on a broken Tron joystick.

What type of computer were you using?  I'dve sworn the VIC did not work that way.

I'll stick that dollar in the pouch of the next roo I see.  I figure it'll get to you eventually. :)
Title: Re: interesting Pac fact
Post by: Bones on December 06, 2005, 06:02:27 am
What type of computer were you using? I'dve sworn the VIC did not work that way.
Texas Instruments TI99/4A.

Logic tells me that a computer can not "think-up" a random number but I will be damed if I understand how it does it. Being a very basic machine there was no onboard clock or anything fancy like that the machine could use to help generate "randomness".

Generating random numbers was probably the slowest command the old machine had. It would literally take 1/3 a second to think up a number and print it. When I was writing games on the TI I would generate all the random numbers before the game started and then just draw them out or arrays because to generate the numbers on the fly slowed the system down ridiculously.
Title: Re: interesting Pac fact
Post by: RayB on December 06, 2005, 01:24:41 pm
Every computer has a "clock". Not necessarily a clock that tells you the hour and minutes, but a single register or memory location that continuously increments.