Help me make the most random loop ever! (add on)
08-01-06, 10:58 PM
Code Guru
Join Date: Sep 2004
Location: Traverse City, MI, USA
Posts: 821
Thanks: 0
Thanked 0 Times in 0 Posts
Help me make the most random loop ever! (add on)
Version 1.0
If you think of more ways to make it random please tell me! =)
PHP Code:
// RANDOMIZER
$border_style = array( 'hidden' , 'dotted' , 'dashed' , 'solid' , 'double' , 'groove' , 'ridge' , 'inset' , 'outset' );
$text_dec = array( 'underline' , 'overline' , 'line-through' );
$font_style = array( 'normal' , 'italic' , 'oblique' );
$fonts = array( 'Trebuchet MS' , 'Monaco' , 'Courier New' , 'Helvetica' , 'SunSans-Regular' , 'sans-serif' , 'monospace' , 'Comic Sans MS' );
$font_bolding = array( 'normal' , 'bold' , 'bolder' , 'lighter' , 100 , 200 , 300 , 400 , 500 , 600 , 700 , 800 , 900 );
$array = '0123456789abcdef' ;
$how_many_loops = mt_rand ( 1 , 1000 );
for( $i = 1 ; $i <= $how_many_loops ; $i ++)
{
echo '<span style="
background-color:#' . $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. ';
position:absolute;
top:' . mt_rand ( 0 , 700 ). 'px;
left:' . mt_rand ( 0 , 800 ). 'px;
z-index:' . $i . ';
padding-right:' . mt_rand ( 1 , 10 ). 'px;
padding-left:' . mt_rand ( 1 , 10 ). 'px;
border-top-width:' . mt_rand ( 1 , 5 ). 'px;
border-top-style:' . $border_style [ mt_rand ( 1 , 9 )- 1 ]. ';
border-top-color:#' . $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. ';
border-bottom-width:' . mt_rand ( 1 , 5 ). 'px;
border-bottom-style:' . $border_style [ mt_rand ( 1 , 9 )- 1 ]. ';
border-bottom-color:#' . $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. ';
border-left-width:' . mt_rand ( 1 , 5 ). 'px;
border-left-style:' . $border_style [ mt_rand ( 1 , 9 )- 1 ]. ';
border-left-color:#' . $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. ';
border-right-width:' . mt_rand ( 1 , 5 ). 'px;
border-right-style:' . $border_style [ mt_rand ( 1 , 9 )- 1 ]. ';
border-right-color:#' . $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. ';">
<font color="' . $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. $array [ mt_rand ( 1 , 16 )- 1 ]. '" face="' . $fonts [ mt_rand ( 1 , 16 )- 1 ]. '" style="font-size:' . mt_rand ( 5 , 40 ). 'px;font-weight:' . $bolding_bolding [ mt_rand ( 1 , 13 )- 1 ]. ';font-style:' . $font_style [ mt_rand ( 1 , 3 )- 1 ]. ';text-decoration:' . $text_dec [ mt_rand ( 1 , 3 )- 1 ]. ';letter-spacing:' . mt_rand ( 1 , 10 ). 'px;">' . $i . '</font></span>' ;
}
Last edited by nova912; 08-01-06 at 11:04 PM .
08-02-06, 06:39 AM
Wannabe Coder
Join Date: Jun 2006
Posts: 225
Thanks: 0
Thanked 0 Times in 0 Posts
What is the use of your script?
I assume the layout will be pretty, eh, Random?
08-02-06, 06:56 AM
Community Leader
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
08-02-06, 10:58 AM
Coding Addict
Join Date: Jul 2006
Location: Scotland
Posts: 302
Thanks: 0
Thanked 0 Times in 0 Posts
Handy...
08-02-06, 12:05 PM
Newbie Coder
Join Date: Jun 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
atleast funny
i think i will try it out to test how it would look on my homepage
08-02-06, 05:48 PM
Code Guru
Join Date: Sep 2004
Location: Traverse City, MI, USA
Posts: 821
Thanks: 0
Thanked 0 Times in 0 Posts
keep adding to it, try and find more things to change randomly =)
08-02-06, 06:02 PM
Community VIP
Join Date: Mar 2005
Location: ProgrammingTalk
Posts: 2,449
Thanks: 0
Thanked 6 Times in 5 Posts
ROTFL
That's pretty random!
08-02-06, 07:53 PM
Code Guru
Join Date: Sep 2004
Location: Traverse City, MI, USA
Posts: 821
Thanks: 0
Thanked 0 Times in 0 Posts
This script morphed from trying to figure out how long exactly i have been going out with my girl. I found out the way to do it then i thought "i could make a page background from the strtotime() numbers thats different every second", then i though, hmmmm what else can I do haha
08-03-06, 02:18 PM
Newbie Coder
Join Date: Aug 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
LOL, nice. How about this: random width and height, and random number for the top and left attributes.
08-03-06, 05:00 PM
Wannabe Coder
Join Date: Jun 2006
Posts: 225
Thanks: 0
Thanked 0 Times in 0 Posts
You could of course add random content, and then let the color, size and font of each character differ (but then it begins to look really ugly).
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes
Linear Mode
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off