View Single Post
Old 10-17-2009, 10:14 PM  
keenan
Registered User
 
Join Date: Jan 2004
Location: Canadia
Posts: 54
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.
__________________
http://www.bleepo.org
keenan is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote