Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: Re: FLASH: Trick or Treat has a bug in it!
From: John Croteau
Date: Sat, 3 Oct 1998 14:08:34 +0100

Hi all,

I was requested to give an analysis of the actual properties of the
below random function and I have the correct odds for this function:

The 1.JPGs will appear randomly about 50% of the time.
The 2.JPGs will appear randomly about 33 1/3% of the time.
The 3.JPGs will appear randomly about 16 2/3% of the time.

These are the mathematically correct odds except there may be a slight
difference of about 1 in 10000000000000000 which I don't feel is worth
analyzing.
My previous odds were estimates based on a quick test.
Anyone who wants more details on how this was figured out please Email
me directly.

> Hey, when John pointed out that my "Trick or Treat" random picture generator
> wasn't exactly random he was right!
It is random, it just doesn't provide equal odds for each pix.

> It does turn things out at around a 55, 35, 10 ratio.
See above for more exact figures.

> http://www.websitepartners.com
> <SCRIPT language="JavaScript">
> <!--
> var image_count = 3
> function tot(){
> var left = Math.round(Math.random()*image_count)
> var middle = Math.round(Math.random()*image_count)
> var right = Math.round(Math.random()*image_count)
> if (left < 1)
> left = 1
> if (middle < 1)
> middle = 1
> if (right < 1)
> right = 1
> eval("document.images['left'].src = 'left_"+left+".JPG'")
> eval("document.images['middle'].src = 'middle_"+middle+".JPG'")
> eval("document.images['right'].src = 'right_"+right+".JPG'")
> }
> //-->
> </SCRIPT>

----------- -----------------------
John Croteau croteauaterols [dot] com (mailto:croteauaterols [dot] com)
------------- -------------------------
Flash Central(The Universe Starts Here) http://www.FlashCentral.com/
FlashTeK(Advanced Websites with Flash) http://www.CrownMall.com/Flash/
The Flash Tech Resource (Tech Notes) http://www.FlashCentral.com/tech/
Need a PC ? -- Computer King -- http://www.crownmall.com/computers/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

------------------------------------------------------------------------
To UNSUBSCRIBE send: unsubscribe flasher in the body of an
email to list-manageratshocker [dot] com. Problems to: owneratshocker [dot] com
N.B. Email address must be the same as the one you used to subscribe.
For info on digest mode send: info flasher to list-manageratshocker [dot] com


Replies
  Re: FLASH: Trick or Treat has a bug in i, William Rosetti

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]