Skip to content

Instantly share code, notes, and snippets.

@kazoo04
Created October 20, 2013 11:41
Show Gist options
  • Save kazoo04/7068449 to your computer and use it in GitHub Desktop.
Save kazoo04/7068449 to your computer and use it in GitHub Desktop.
@bra_ro_
answer = "ABABCD"
chars = answer.split('').uniq
str = ""
count = 0
while not str.end_with? answer
count += 1
c = chars.sample
print c
str += c
end
puts "\ncount = #{count}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment