fork(1) download
  1.  
  2. local secret = "hi"
  3. local answer = "__"
  4.  
  5. for i=0,6,1 do
  6. local fuck = secret:gsub(io.read(), "_")
  7. for j=1,#fuck do
  8. if fuck:sub(j,j) == "_" then
  9. answer = answer:sub(1, j-1) .. secret:sub(j,j) .. answer:sub(j+1)
  10. end
  11. end
  12. print(answer)
  13. if answer == secret then
  14. print("You win")
  15. break
  16. end
  17. end
  18. print("The word was "..secret)
Success #stdin #stdout 0s 2848KB
stdin
e
g
h
j
k
i
stdout
__
__
h_
h_
h_
hi
You win
The word was hi