FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Random function
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Random function [message #180574 is a reply to message #180551] Wed, 27 February 2013 11:17 Go to previous messageGo to previous message
Markus Grob is currently offline  Markus Grob
Messages: 9
Registered: September 2011
Karma:
Junior Member
Salvatore schrieb:
> On 2013-02-25, sonnichjensen(at)gmail(dot)com <sonnichjensen(at)gmail(dot)com> wrote:
>> I use the rand function to get 10 items of 1808 current itemes.
>
> If you want ten random items from an array, you could try the following:
>
> <?php
> // This is the big array you're pulling something out of.
> $lotsOfItems = array( /* ... */ );
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
....

Sorry, but this line is the problem, which every pseudo random generator
has. What will you fill in here. What is really different. Do you have
anything, that's changing in an order, you couldn't tell?
If you choose the time, then you have a changing startvalue, but the
calculating is always the same, so that you can say, what the results
will be.
If you choose keyboardinputs, then you may have no input so you will
have an empty seed.
You can mix it (like every pseudo random generator does) and try to
calculate in a way, that a user can't tell, what the result will be, but
you will never have a random seed, so you will never have a random
calculation.
You can try to choose chaotic elements, but you have to fill them in
your array without loosing the chaotic element ;-)

Greetings from Switzerland, Markus
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Request for proofreading
Next Topic: XML error when accessing a certain method of a wsdl service
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 09:28:58 GMT 2024

Total time taken to generate the page: 0.06651 seconds