#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2008
    Posts
    2
    Rep Power
    0

    Password Creator


    Hello,

    I'm just starting and need some help. I learned XML by working on random things. And in Ruby, I want to make a password creator. But I want it to generate the password over a few inputs. I want it to where you open the program. Input your First Name, Zip Code, Middle Name, Age * 2 and a Random name or number. It then splits all of those up and randomizes them.

    Goofy, but would be strong.

    If this is possible, can someone help me create it?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2004
    Location
    Constant Limbo
    Posts
    989
    Rep Power
    363
    Code:
    irb(main):001:0> name = "First"
    => "First"
    irb(main):002:0> zip = "90210"
    => "90210"
    irb(main):003:0> middle = "Name"
    => "Name"
    irb(main):004:0> age = 42
    => 42
    irb(main):005:0> other = "PetName"
    => "PetName"
    irb(main):006:0> ary = [name,zip,middle,age,other]
    => ["First", "90210", "Name", 42, "PetName"]
    irb(main):007:0> ary.collect { |i| i.to_s }.join.split(//).sort_by { rand }.join
    => "4mai1ttaP20se20Nrem9eNF"
    Of course, if you want repeatable results you will want to seed the random number generator.
    True happiness is not getting what you want, it's wanting what you've already got.

    My Blog
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2008
    Posts
    2
    Rep Power
    0
    TY! I gave you credit for creating the script. Now I want to add a link at the bottom. Is their a code for that?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2004
    Location
    Constant Limbo
    Posts
    989
    Rep Power
    363
    What exactly do you mean 'a link'? And where is the bottom? Please be a little more clear so that we can help you out.
    True happiness is not getting what you want, it's wanting what you've already got.

    My Blog
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2008
    Posts
    176
    Rep Power
    30
    I really want to have some idea about Ruby!
    Please explain

    Brief explanation will be enough

    Tnx
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2004
    Location
    Constant Limbo
    Posts
    989
    Rep Power
    363
    If you want to know about something, the appropriate method is to start a new post.
    Start a new post, ask a direct question (about what you would like to learn) and you will get replies.
    True happiness is not getting what you want, it's wanting what you've already got.

    My Blog

IMN logo majestic logo threadwatch logo seochat tools logo