Skip to content

Commit

Permalink
Mastermind: Fixed a bug where strings that have every character wrong…
Browse files Browse the repository at this point in the history
… didn't get displayed to the terminal
  • Loading branch information
iagox86 committed Jan 12, 2016
1 parent 5e4f15a commit dbd4d6b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/dnsmastermind.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@
puts("WINNER!!!")
answer = opts[:win]
elsif(guess.length == solution.length)
puts("Guess: #{guess}")

saved_guess = guess
tmp_solution = solution.chars.to_a()
guess = guess.chars.to_a()
answer = ""
Expand All @@ -96,6 +95,8 @@
if(answer == "")
answer = "No correct character; keep trying!"
end

puts("Guess: #{saved_guess} => #{answer}")
else
puts("Invalid; sending instructions: #{guess}")
answer = "Instructions: guess the #{solution.length}-character string: dig -t txt [guess].#{domain}! 'O' = correct, 'X' = correct, but wrong position"
Expand Down

0 comments on commit dbd4d6b

Please sign in to comment.