GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   script to generate random letters.... (https://gfy.com/showthread.php?t=933891)

qwe 10-17-2009 08:55 PM

script to generate random letters....
 
can someone hook me up with a php script to generate patterns like this in .txt file:
aa
ab
ac
ad
ae
af
.
etc
.
ba
bb
bc
bd
.
etc
.
wa
wb
wc

thanks :)

woj 10-17-2009 09:11 PM

if you want to invest a few bucks, icq: 33375924

woj 10-17-2009 09:33 PM

done :thumbsup

keenan 10-17-2009 10:14 PM

Code:

dim charCnt(1)

call allcombos "abc",3

sub allcombos charstr$,combolen
    redim charCnt(combolen)
    charstrlen=len(charstr$)
    for i=1 to charstrlen^combolen

        t$=""
        for k=combolen to 1 step -1
            t$=t$+mid$(charstr$,charCnt(k)+1,1)
        next k
        print t$

        charCnt(1)=charCnt(1)+1
        for k=1 to combolen
            if charCnt(k)=charstrlen then
                if k<combolen then charCnt(k+1)=charCnt(k+1)+1
                charCnt(k)=0
            end if
        next k

    next i
end sub

credits go to Kc, written in basic.

GrouchyAdmin 10-17-2009 10:30 PM

That isn't really random, that's following a pattern.

rowan 10-17-2009 11:29 PM

*nix "sh" script

Code:

for x in a b c d e f g h i j k l m n o p q r s t u v w x y z
do
  for y in a b c d e f g h i j k l m n o p q r s t u v w x y z
  do
    echo ${x}${y}
  done
done


SleazyDream 10-18-2009 01:48 AM

should be easy to make for a programer

keenan 10-18-2009 07:11 AM

Code:

#include<stdio.h>

bool __cdecl Increment( char* lpToken, unsigned long dwLen )
{
        char* pStart = lpToken;
        lpToken = &lpToken[ dwLen ];
       
        do
        {
                switch ( ++lpToken[ 0 ] )
                {
                case 'Z'+1:
                        lpToken[0] = 'a';
                        return 1;
                        break;
                case 'z'+1:
                        lpToken[0] = '0';
                        return 1;
                        break;
                case '9'+1:
                        lpToken[0] = 'A';
                        break;
                default:
                        return 1;
                }
                lpToken--;
        } while ( lpToken >= pStart );

        return 0;
}


int main( void )
{

        char szString[ 10 ];
        unsigned long dwLength = 1;
        *(unsigned short*)(szString) = 'A'; // unsigned short so we can copy the sz null.
       

        for ( unsigned long i = dwLength - 1; i < sizeof( szString ) -1; i++ )
        {
                do
                {
                        printf( "%s\n", szString );
                        //getchar( ); // uncomment to pause inc display.

                } while ( Increment( szString, dwLength -1 ) );
                *(unsigned short*)(szString+dwLength++) = 'A'; // ''
        }

       

        return 0;
}

credits to a helpful guy at another forum.

Quote:

Originally Posted by TheUmbra
For optimization you will need to remove the excessive branching in Increment().


k0nr4d 10-18-2009 08:31 AM

PHP Code:

$array = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
shuffle($array);
$string $array[0].$array[1]; 

edit: nevermind, seems you wanted a pattern like that not random. didn't read properly

SpyCam 10-18-2009 09:08 AM

so, who's the winner?

seeandsee 10-18-2009 09:11 AM

wow php contest

keenan 10-18-2009 09:20 AM

Why you would want a php script to do this I don't know. Just open up visual studio and run one of the sources I posted. Bam you've got a word list suitable for brute force.

quantum-x 10-18-2009 09:29 AM

Quote:

Originally Posted by k0nr4d (Post 16440602)
PHP Code:

$array = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
shuffle($array);
$string $array[0].$array[1]; 

edit: nevermind, seems you wanted a pattern like that not random. didn't read properly


Psst - http://fr.php.net/range

Jakez 10-18-2009 03:16 PM

aa
ab
ac
ad
ae
af
ag
ah
ai
aj
ak
al
am
an
ao
ap
aq
ar
as
at
au
av
aw
ax
ay
az
ba
bb
bc
bd
be
bf
bg
bh
bi
bj
bk
bl
bm
bn
bo
bp
bq
br
bs
bt
bu
bv
bw
bx
by
bz
ca
cb
cc
cd
ce
cf
cg
ch
ci
cj
ck
cl
cm
cn
co
cp
cq
cr
cs
ct
cu
cv
cw
cx
cy
cz
da
db
dc
dd
de
df
dg
dh
di
dj
dk
dl
dm
dn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rf
rg
rh
ri
rj
rk
rl
rm
rn
ro
rp
rq
rr
rs
rt
ru
rv
rw
rx
ry
rz
sa
sb
sc
sd
se
sf
sg
sh
si
sj
sk
sl
sm
sn
so
sp
sq
sr
ss
st
su
sv
sw
sx
sy
sz
ta
tb
tc
td
te
tf
tg
th
ti
tj
tk
tl
tm
tn
to
tp
tq
tr
ts
tt
tu
tv
tw
tx
ty
tz
ua
ub
uc
ud
ue
uf
ug
uh
ui
uj
uk
ul
um
un
uo
up
uq
ur
us
ut
uu
uv
uw
ux
uy
uz
va
vb
vc
vd
ve
vf
vg
vh
vi
vj
vk
vl
vm
vn
vo
vp
vq
vr
vs
vt
vu
vv
vw
vx
vy
vz
wa
wb
wc
wd
we
wf
wg
wh
wi
wj
wk
wl
wm
wn
wo
wp
wq
wr
ws
wt
wu
wv
ww
wx
wy
wz
xa
xb
xc
xd
xe
xf
xg
xh
xi
xj
xk
xl
xm
xn
xo
xp
xq
xr
xs
xt
xu
xv
xw
xx
xy
xz
ya
yb
yc
yd
ye
yf
yg
yh
yi
yj
yk
yl
ym
yn
yo
yp
yq
yr
ys
yt
yu
yv
yw
yx
yy
yz
za
zb
zc
zd
ze
zf
zg
zh
zi
zj
zk
zl
zm
zn
zo
zp
zq
zr
zs
zt
zu
zv
zw
zx
zy
zz

I know there's an easier way of doing this but I like to do stuff a weird/hard way rofl.
<?php
$arr="a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z";
$arr_ex=explode("/",$arr);
for($i=0;$i<count($arr_ex)*2;$i++)
{
if($arr[$i]=="/"){continue;}
print "$arr[$i]a<br>";
print "$arr[$i]b<br>";
print "$arr[$i]c<br>";
print "$arr[$i]d<br>";
print "$arr[$i]e<br>";
print "$arr[$i]f<br>";
print "$arr[$i]g<br>";
print "$arr[$i]h<br>";
print "$arr[$i]i<br>";
print "$arr[$i]j<br>";
print "$arr[$i]k<br>";
print "$arr[$i]l<br>";
print "$arr[$i]m<br>";
print "$arr[$i]n<br>";
print "$arr[$i]o<br>";
print "$arr[$i]p<br>";
print "$arr[$i]q<br>";
print "$arr[$i]r<br>";
print "$arr[$i]s<br>";
print "$arr[$i]t<br>";
print "$arr[$i]u<br>";
print "$arr[$i]v<br>";
print "$arr[$i]w<br>";
print "$arr[$i]x<br>";
print "$arr[$i]y<br>";
print "$arr[$i]z<br>";
}
?>

fris 10-18-2009 03:42 PM

Quote:

Originally Posted by keenan (Post 16440693)
Why you would want a php script to do this I don't know. Just open up visual studio and run one of the sources I posted. Bam you've got a word list suitable for brute force.

because visual stidio blows chunks

quantum-x 10-18-2009 03:44 PM

Quote:

Originally Posted by Jakez (Post 16441324)
I know there's an easier way of doing this but I like to do stuff a weird/hard way rofl.
<?php
$arr="a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z";
$arr_ex=explode("/",$arr);
for($i=0;$i<count($arr_ex)*2;$i++)
{
if($arr[$i]=="/"){continue;}
print "$arr[$i]a<br>";
print "$arr[$i]b<br>";
print "$arr[$i]c<br>";
print "$arr[$i]d<br>";
print "$arr[$i]e<br>";
print "$arr[$i]f<br>";
print "$arr[$i]g<br>";
print "$arr[$i]h<br>";
print "$arr[$i]i<br>";
print "$arr[$i]j<br>";
print "$arr[$i]k<br>";
print "$arr[$i]l<br>";
print "$arr[$i]m<br>";
print "$arr[$i]n<br>";
print "$arr[$i]o<br>";
print "$arr[$i]p<br>";
print "$arr[$i]q<br>";
print "$arr[$i]r<br>";
print "$arr[$i]s<br>";
print "$arr[$i]t<br>";
print "$arr[$i]u<br>";
print "$arr[$i]v<br>";
print "$arr[$i]w<br>";
print "$arr[$i]x<br>";
print "$arr[$i]y<br>";
print "$arr[$i]z<br>";
}
?>

Let me go on record to say: Never, ever hire this dude to code anything.
Anything.

Robocrop 10-18-2009 04:05 PM

Quote:

Originally Posted by quantum-x (Post 16441391)
Let me go on record to say: Never, ever hire this dude to code anything.
Anything.

:1orglaugh:1orglaugh:1orglaugh

aic1 10-18-2009 04:19 PM

Quote:

Originally Posted by quantum-x (Post 16441391)
Let me go on record to say: Never, ever hire this dude to code anything.
Anything.

I would hire the guy any time. I prefer a guy that can give me a quick and stable solution, than one that gives me a solution in 4 lines of code, with bugs, and his head up his ass.

quantum-x 10-18-2009 06:38 PM

Quote:

Originally Posted by aic1 (Post 16441452)
I would hire the guy any time. I prefer a guy that can give me a quick and stable solution, than one that gives me a solution in 4 lines of code, with bugs, and his head up his ass.

Hire away.

BTW, here's your smart-arse 4 line solution - done in 1 line!

<? foreach(range('a','z') as $v) foreach(range('a','z') as $k) echo $v.$k."<br />" ?>

Jakez 10-18-2009 08:24 PM

Quote:

Originally Posted by quantum-x (Post 16441391)
Let me go on record to say: Never, ever hire this dude to code anything.
Anything.

Hahaha, I had a brain fart. I would never leave something like that for money (not that I am for hire anyway), it actually has a bug but I didn't feel like fixing it, hopefully he just wanted the list and not an actual code.

keenan 10-18-2009 09:59 PM

Quote:

Originally Posted by fris (Post 16441384)
because visual stidio blows chunks

http://www.allowe.com/images/Demotiv...tivation25.jpg

woj 10-18-2009 10:09 PM

problem was taken care of 24 hours ago, wtf guys? :1orglaugh

d-null 10-18-2009 10:16 PM

Quote:

Originally Posted by woj (Post 16442030)
problem was taken care of 24 hours ago, wtf guys? :1orglaugh

so did the op want "random" letters like he asks in the thread title or "patterned" letters like he asks in the first post?? :upsidedow

woj 10-18-2009 10:17 PM

Quote:

Originally Posted by d-null (Post 16442040)
so did the op want "random" letters like he asks in the thread title or "patterned" letters like he asks in the first post?? :upsidedow

"patterned"...


All times are GMT -7. The time now is 09:43 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123