![]() |
![]() |
![]() |
||||
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. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
So Fucking Banned
Industry Role:
Join Date: Apr 2002
Location: ¤ª"˜¨๑۩۞۩๑¨˜"ª¤
Posts: 18,481
|
How do you shuffle the lines of a text file?
Found some PHP options, but I'd rather paste it into a text box and have javascript do it or something.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
So fuckin' bored
Industry Role:
Join Date: Jun 2003
Posts: 32,386
|
There is no PHP-like shuffle function in JavaScript, so you have to do it like this:
Code:
shuffle = function(myArray) { for (var tmp, j, i = myArray.length; i; j = parseInt(Math.random()*i), tmp = myArray[--i], myArray[i] = myArray[j], myArray[j] = tmp); return myArray; };
__________________
Obey the Cowgod |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 | |
Too lazy to set a custom title
Industry Role:
Join Date: May 2004
Location: West Coast, Canada.
Posts: 10,217
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
So Fucking Banned
Industry Role:
Join Date: Apr 2002
Location: ¤ª"˜¨๑۩۞۩๑¨˜"ª¤
Posts: 18,481
|
Thanks a lot.
Bump for anyone who wanted to randomize a big list of FHG's. |
![]() |
![]() ![]() ![]() ![]() ![]() |