You are here: Re: generate 2 random numbers in rapid sequence « PHP Programming Language « IT news, forums, messages
Re: generate 2 random numbers in rapid sequence

Posted by Geoff Berrow on 04/23/06 12:35

Message-ID: <rfmdnWoymrRuqNbZnZ2dnUVZ_tednZ2d@comcast.com> from Jim
Michaels contained the following:

>well, I have one last thing I can do.

More than that. I've used rand() loads of times and not had a problem.

See:http://www.ckdog.co.uk/phpcourse/DICE/DICEGAME.PHP which picks two
random numbers and displays images according to what the number is.

With the code

$num=rand(1,6);
$num2=rand(1,6);
$total=$num+$num2;

$num1 and $num2 are only occasionally the same (as you might expect)


Full code here:-

http://www.ckdog.co.uk/phpcourse/DICE/dicegame.phps
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация