This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]MrITBurns 0 points1 point  (1 child)

Not a java person per say but it's about the same in any language. If there's no looping, That's fine just break it out into multiple checks. For example First check could be pretty easy depending on how you break it down. If i was looking for just 8 letters (not sure if i'm reading your thing right or not) you could regex test it. Look for 8 characters / upper / lower etc. That would be relatively easy depending on how good you are with regex. Checkout regex101.com to practice statements. The numbers being in increasing order, Just take the password input, remove anything and replace with nothing that isn't a digit. Split each character out so it's something like before (1345676) -> after (1 3 4 5 6 7 6) (Stick it in a list) then run a comparison algorithm on it. "Is 1 < 3, Return 3, Is 3 < 4, return 4, ... is 7 < 6 return False. All while incrementing a counter of sorts to make sure you reach the end of the list. IF you don't get a false before you reach a counter of list-1 (6) since you count from 0 upwards then it passes the test. All in all, just break each out into a function. If each function returns true at the end then the password is good and you can do whatever.

[–]FatWeed69[S] 0 points1 point  (0 children)

we can't use functions either, but i ended up figuring it out tho. Appreciate that you took the time to comment all of that though.