|
Posted by Kimmo Laine on 11/18/46 11:42
"Tyxod" <yrizos@gmail.com> wrote in message
news:1142426997.598055.231730@j52g2000cwj.googlegroups.com...
> When I say that "I really dont like doing that", I mean that I really
> don't LIKE that! :) It has nothing to do with the semantics of it, and
> I agree with any other solution that worx, but I do not enjoy coding
> like that. That's just me...
Well, I'm different. I don't like to "reinvent the wheel" every time I code
something, if such functionality already exists in the function library, I
use it rather than rewrite the whole thing.
As for the list being 58 elements instead of just 13, it can be easily
truncated to that using array_slice($randomstuff,-13) after the shuffle() so
that ain't no problem either.
It's just that it took me a minute or two to come up with the range and
shuffle solution, while writing the recursive function would mean a lot more
work. I like to keep it neat and tidy, short and simple. Good old KISS and
LOVE rules apply, Keep It Simple, Stupid and Leave Out Virtually Everything.
--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviφ
spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)
[Back to original message]
|