Sign in to follow this  
Followers 0
blind2k

hello, i need you guys' help

3 posts in this topic

first of all hello, it seems like a nice community.

now, i need some of your help.

i need a script wich i input a password with small letters like "asdf" and it will sort it in a txt file or whatever all the case sensitive options. like:

ASDF

ASDf

ASdf

Asdf

asdf

AsDf

AsDF

ASdf

AsdF

and go on, all the options.

can someone please help me?

Share this post


Link to post
Share on other sites



Try using the String functions. IE: StringLower, StringLeft, StringRight, StringMid, StringUpper. I don't think those are all of them, just the ones on the top of my head.

After you've tried, and failed (if you do fail), come back and post the script.


What goes around comes around... Payback's a bitch.

Share this post


Link to post
Share on other sites

I was particularly annoyed with myself that I couldn't find a better way to do this...im sure there's a better way using BitAnd() instead of a freaking string of 1's and 0's...

anyways, fun little logic practice, here you go-

$input=StringLower(InputBox("Enter Phrase",""))
if $input="" then Exit
$file=FileOpen(@scriptdir&"\output.txt",2)
for $i=0 to 2^StringLen($input)-1
    $tempstring=""
    for $n=1 to StringLen($input)
        if StringMid(_ToBinaryString($i,Stringlen($input)),$n,1)="1" Then
            $tempstring&=StringUpper(StringMid($input,$n,1))
        Else
            $tempstring&=StringMid($input,$n,1)
        EndIf
    Next
    FileWriteLine($file,$tempstring)
Next

func _ToBinaryString($in,$length)
    $out=""
    for $i=1 to $length
        if Mod($in,2)=1 then
            $out&="1"
        Else
            $out&="0"
        EndIf
        $in=Floor($in/2)
    Next
    Return $out
EndFunc
func _CaseSwitch($in)
    if Asc($in)<91 then 
        return StringLower($in)
    Else
        Return StringUpper($in)
    EndIf
EndFunc

Things get quite sluggish with phrases longer than 12 or so...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0