Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 03-18-2005, 11:55 PM   #1
OzMan
Confirmed User
 
OzMan's Avatar
 
Join Date: Sep 2003
Location: Los Begas
Posts: 9,162
Best way to randomize a text list???

I have a text file of the form:

word1
word2
word3
word4
word5
etc

and I want something that will randomly change the order, for example:

word3
word1
word5
word2
word4

Any suggestions?

Last edited by OzMan; 03-18-2005 at 11:56 PM..
OzMan is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-19-2005, 12:05 AM   #2
smack
Push Porn Like Weight.
 
smack's Avatar
 
Industry Role:
Join Date: Mar 2002
Location: Inside .NET
Posts: 10,652
what language do you want to use?

in VB i would just have a randomize statement run from the lbound to the ubound of the array and write them to a different file.
__________________
Cry havoc and let slip the dogs of war.
smack is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-19-2005, 12:09 AM   #3
newbreed
Confirmed User
 
newbreed's Avatar
 
Join Date: Nov 2003
Location: ThatOneProgram.com
Posts: 9,898
<?php

randomize OzMan's text!

?php>



















j/k, I have no idea, but if that works, cheers man!
__________________

Loryn ‎(3:16 PM):
I love it, just as long as we keep the bedroom door closed from all ears then we can have throw down hard core sex that makes us money haha
fuck it we can have sex on money never did that before
newbreed is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-19-2005, 12:13 AM   #4
OzMan
Confirmed User
 
OzMan's Avatar
 
Join Date: Sep 2003
Location: Los Begas
Posts: 9,162
I just want a simple desktop app like textpad or something.

There are a bunch that will sort a file .. alpha numeric ascending descending etc but I wanna do the opposite I guess
OzMan is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-19-2005, 12:15 AM   #5
Crypt
Confirmed User
 
Join Date: Apr 2004
Posts: 2,225
Quote:
Originally Posted by OzMan
I just want a simple desktop app like textpad or something.

There are a bunch that will sort a file .. alpha numeric ascending descending etc but I wanna do the opposite I guess
ListMate ;)
Crypt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-20-2005, 01:51 AM   #6
OzMan
Confirmed User
 
OzMan's Avatar
 
Join Date: Sep 2003
Location: Los Begas
Posts: 9,162
Quote:
Originally Posted by Crypt
ListMate ;)
checking that out , Thanks

anyone else?
OzMan is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-20-2005, 01:55 AM   #7
2HousePlague
CURATOR
 
Join Date: Jul 2004
Location: the attic
Posts: 14,572
Is this for ENCRYPTION purposes?

If so, try this...


j-
__________________
tada!
2HousePlague is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-20-2005, 02:00 AM   #8
Explicit
Confirmed User
 
Join Date: Jul 2004
Posts: 814
simple code, and im not a programmer. assign em each a variable, randomize the lot, order from least to greatest.. or somethin
Explicit is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-20-2005, 02:26 AM   #9
xl11
Confirmed User
 
Industry Role:
Join Date: Jul 2003
Posts: 712
PHP Code:

<?

$data = file('data.txt');

shuffle($data);

foreach ($data as $value) {

   echo "Value: $value<br />\n";

}
?>
xl11 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-20-2005, 03:00 AM   #10
The Sultan Of Smut
Confirmed User
 
The Sultan Of Smut's Avatar
 
Join Date: Dec 2004
Location: Vancouver
Posts: 4,325
You can use Excel and put your text in column A and then use the rand function in column B then sort.
The Sultan Of Smut is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-20-2005, 03:04 AM   #11
Dirty F
Too lazy to set a custom title
 
Dirty F's Avatar
 
Industry Role:
Join Date: Jul 2001
Posts: 59,204
elistpro ;)
Dirty F is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-20-2005, 03:18 AM   #12
Explicit
Confirmed User
 
Join Date: Jul 2004
Posts: 814
Quote:
Originally Posted by xl11
PHP Code:

<?

$data = file('data.txt');

shuffle($data);

foreach ($data as $value) {

   echo "Value: $value<br />\n";

}
?>
wow, i was pretty damn close ehh, thanks for the visual.
Explicit is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-20-2005, 03:19 AM   #13
bbe
Confirmed User
 
Join Date: Feb 2005
Posts: 110
#!/usr/bin/perl

# Read File
while (<>) {
push(foo, $_);
}

# Shuffle lines
srand;
for (0..$#foo) {
$r = rand($#foo+1);
($foo[$r], $foo[$_]) = ($foo[$_], $foo[$r]);
}

# Print it out
for (0..$#foo) {
print $foo[$_];
}
bbe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-20-2005, 04:38 AM   #14
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,372
$filename = "ban.txt";
$sites = file($filename);
srand ((double) microtime() * 1000000);
$a = rand(0, sizeof($sites) - 1);
echo $sites[$a];
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-20-2005, 04:39 AM   #15
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,372
in ban.txt put a list on each line
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-20-2005, 11:29 AM   #16
OzMan
Confirmed User
 
OzMan's Avatar
 
Join Date: Sep 2003
Location: Los Begas
Posts: 9,162
Interesting ideas here Thanks for the info
OzMan is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-20-2005, 11:32 AM   #17
KRosh
So Fucking Outlawed
 
KRosh's Avatar
 
Industry Role:
Join Date: Nov 2001
Posts: 5,114
elistpro


or textpad I think does it .. and it's free
KRosh is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-20-2005, 12:38 PM   #18
WebTitan
Confirmed User
 
Join Date: Mar 2003
Location: Western NY
Posts: 5,114
Quote:
Originally Posted by The Sultan Of Smut
You can use Excel and put your text in column A and then use the rand function in column B then sort.
was going to be my suggestion
WebTitan is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.