Can't get this function to work
<p>I'm trying to build a hangman game using instructions from codecademy, but I'm having a hard time following alone. In the guessLetter function below, I've added two lines of code following the instructions they gave me</p>

<p>This</p>

<pre><code>shown = alterAt(checkLetter,letter,shown);           ///this is mine
</code></pre>

<p>and this</p>

<pre><code>checkLetter = indexOf(letter, checkLetter +1); 
</code></pre>

<p>However, I can't get the tests to pass. I'd be grateful if you could assist.</p>

<pre><code>// Skip to guessLetter(). You shouldn't need to touch this function.
function alterAt ( n, c, originalString ) {
    return originalString.substr(0,n) + c + originalString.substr(n+1,originalString.length);
}

function guessLetter( letter, shown, answer ) {
    var checkLetter = -1;  // This variable will hold the indexOf()

    checkLetter = answer.indexOf(letter); // Single Argument Version starting at 0
    while ( checkLetter &gt;= 0 ) {

        // Replace the letter in shown with alterAt() and then store in shown.
       shown = alterAt(checkLetter,letter,shown);           ///this is mine
        // Use indexOf() again and store in checkLetter

        checkLetter = indexOf(letter, checkLetter +1);       ///this is mine
    }

    // Return our string, modified or not
    return shown;
}
</code></pre>

<p><strong>Update</strong></p>

<p>If the guess is correct, it's supposed to return shown modified by the guess. For example, if the word is tree and the player guesses 'e', it should return '__ee.' Here's a fiddle I can't get to work using the word 'whatever': <a href="http://jsfiddle.net/mjmitche/YAPWm/2/" rel="nofollow">http://jsfiddle.net/mjmitche/YAPWm/2/</a></p>
