I know C++, so here's a Clojure solution.
(declare play)
(declare ask)
(def maxincorrect 7)
(def words ["meme" "rick" "derp" "hi"])
(defn guessCorrect [secret position incorrect]
(println "correct guess!")
(play secret (+ position 1) incorrect))
(defn guessIncorrect [secret position incorrect]
(println "incorrect guess!")
(play secret position (+ incorrect 1)))
(defn isCorrectGuess [secret position guess]
(= (subs secret position (+ position 1)) guess))
(defn ask [secret position incorrect]
(println (str "Current guess: " (subs secret 0 position)))
(println (str "lives remaining: " (- maxincorrect incorrect)))
(println "Enter your next guess.")
(if (isCorrectGuess secret position (read-line))
(guessCorrect secret position incorrect)
(guessIncorrect secret position incorrect)))
(defn play [secret position incorrect]
(cond
(= (count secret) position) (println "you won! a winrar is you!")
(= incorrect maxincorrect) (println "you lost, what the frick?")
:else (ask secret position incorrect)))
(play (rand-nth words) 0 0)