-
-
Save Haseeb-Qureshi/a6f3a62bb3ae96442d6fe13288e3739b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def build!(forward:) | |
puts "Current password: #{@password}" | |
ALPHABET.each do |char| | |
guess = forward ? @password + char : char + @password | |
if @api.include?(guess) | |
@password = guess | |
build!(forward: forward) | |
return | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment