fork download
  1. @secret = 'ayy'
  2. @answer = '___'
  3. @mistakes = 7
  4.  
  5. def fuck! ass
  6. @mistakes -= 1 if ass.each{|i| @answer[i] = @secret[i]}.empty?
  7. end
  8.  
  9. def shit dick
  10. (0...@secret.length).select{|i| @secret[i] == dick}
  11. end
  12.  
  13. def balls
  14. puts "Clue: #{@answer}\nGuess a letter:"
  15. gets[0]
  16. end
  17.  
  18. fuck! shit balls while @answer != @secret && @mistakes > 0
  19.  
  20. puts @answer == @secret ? 'you win' : 'fuck you'
  21.  
Success #stdin #stdout 0.02s 9776KB
stdin
e
g
a
j
k
y
stdout
Clue: ___
Guess a letter:
Clue: ___
Guess a letter:
Clue: ___
Guess a letter:
Clue: a__
Guess a letter:
Clue: a__
Guess a letter:
Clue: a__
Guess a letter:
you win