• Post Reply Bookmark Topic Watch Topic
  • New Topic

random.nextInt + If statements  RSS feed

 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am creating a password generator/fake password hacker. Is there a better way to do this?

Thanks,
John Price aka cc11rocks
 
Henry Wong
author
Sheriff
Posts: 23282
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
john price wrote:I am creating a password generator/fake password hacker. Is there a better way to do this?

Thanks,
John Price aka cc11rocks


You seem to have a couple of bugs -- such as 22 is assigned to two letters, but I get the gist of what you are trying to do....

Try....



Henry
 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It works perfect thanks! Could you please explain this:

Like I understand it but why is this possible? I see
"char = char1 + char2 - int"
Thanks,
cc11rocks aka John Price
 
Henry Wong
author
Sheriff
Posts: 23282
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
john price wrote:
Like I understand it but why is this possible? I see
"char = char1 + char2 - int"


Please take another look again. You'll see that it is something else, and it is valid.

Henry
 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your help. Here is the program I came up with:

I'm going to add more JRadioButtons (more password length options), but here it is. It is fully runnable. Thank you very much!
cc11rocks aka John Price
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!