Current location: Hot Scripts Forums » Programming Languages » PHP » Help me make the most random loop ever! (add on)


Help me make the most random loop ever! (add on)

Reply
  #1 (permalink)  
Old 08-01-06, 10:58 PM
nova912's Avatar
nova912 nova912 is offline
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.
Reply With Quote
  #2 (permalink)  
Old 08-02-06, 06:39 AM
duesi's Avatar
duesi duesi is offline
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?

__________________
Duesi

"One of the great skills in using any language is knowing what not to use, what not to say" (Ron Jeffries)

http://www.swissbytes.de
Reply With Quote
  #3 (permalink)  
Old 08-02-06, 06:56 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
Moving to PHP...
Reply With Quote
  #4 (permalink)  
Old 08-02-06, 10:58 AM
landing's Avatar
landing landing is offline
Coding Addict
 
Join Date: Jul 2006
Location: Scotland
Posts: 302
Thanks: 0
Thanked 0 Times in 0 Posts
Handy...
__________________
Always sanitise your data


Best regards
Reply With Quote
  #5 (permalink)  
Old 08-02-06, 12:05 PM
thorerik thorerik is offline
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
Reply With Quote
  #6 (permalink)  
Old 08-02-06, 05:48 PM
nova912's Avatar
nova912 nova912 is offline
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 =)
Reply With Quote
  #7 (permalink)  
Old 08-02-06, 06:02 PM
Christian's Avatar
Christian Christian is offline
Community VIP
 
Join Date: Mar 2005
Location: ProgrammingTalk
Posts: 2,449
Thanks: 0
Thanked 6 Times in 5 Posts
ROTFL

That's pretty random!
__________________
:: ImperialBB :: New version in the works! :: http://www.imperialbb.com ::

:: Have a question about the board? The Rules? An Infraction/Warning? :: Contact Form ::
Reply With Quote
  #8 (permalink)  
Old 08-02-06, 07:53 PM
nova912's Avatar
nova912 nova912 is offline
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
Reply With Quote
  #9 (permalink)  
Old 08-03-06, 02:18 PM
reportingsjr reportingsjr is offline
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.
Reply With Quote
  #10 (permalink)  
Old 08-03-06, 05:00 PM
duesi's Avatar
duesi duesi is offline
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).
__________________
Duesi

"One of the great skills in using any language is knowing what not to use, what not to say" (Ron Jeffries)

http://www.swissbytes.de
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to loop mysql into template system??? how u guys make it??? Eric Hadson PHP 0 09-19-05 10:43 PM
Make this code pull random pictures?! APuppyDog PHP 3 08-26-04 05:13 PM


All times are GMT -5. The time now is 07:23 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.