Hangman Game Course cannot be completed! Please help!

jquery
non-track-course
hangman-game

#1


https://www.codecademy.com/courses/javascript-intermediate-tpoPb/0/1?curriculum_id=4fc3018f74258b0003001f0f


Oops, try again. Make sure you have defined all the variables!


// This array holds the words we are going to choose from.
// Feel free to add new words!
var words = ['cat', 'tree', 'swing', 'around', 'scientist'];

// This function will pick our word
function chooseWord () {
    // Write code here
    return words[Math.floor(Math.random() * words.length)];
}

Hi guys,

i know that this is a non-track course, but i want to complete this course at 100%, i'm stuck at 81%, because i can not complete four first exercises. My code does not pass the validation check and all the time I get the same error message on the screen "Oops, try again. Make sure you have defined all the variables!". This applies to the first four exercises: Rules of the Road, Blanks for your Answer, Replacing a Letter, Guess a Letter, Any Letter!.

I tried to find a solution on the forum Hangman Game Forum, but did not find anything useful, that would help me to solve this problem... On the profiles of some of the forum members, I noticed that they have somehow completed this course, because they have received the course completion badge for Hangman Game.

I appeal to the guys who have dealt with this course and finished it completely. I would be happy for your help and assistance in this matter.

Thanks,
Mark


#2

Simple error :sweat_smile:

All you need to do is pass words as a parameter and you should pass,

// This function will pick our word
function chooseWord (words) {

#3

Thank you, but it does not change anything! The error still exists...


#4

So your code looks like this now?


#5

@bandit

yes, exactly!


#6

Refresh the page and the rewrite this line,

return words[Math.floor(Math.random() * words.length)];


#7

Sorry, but this does not work too...


#8

I don't know what's the problem. Your code is correct.
From instruction:

In function chooseWord() create a function that takes the words array and then returns a random element of the array.

Instruction says create a function in function. I can't understand what it means.
Also I tried your code in Chrome and it works.


#9

@denys.matsevych

thanks for your reply!

This means that it does not work for this exercises:

Regardless of what I tried to do, I keep getting the same error message!

For example here:


#10

Hi all again,

who has more ideas for solutions to this problem? Does someone have any ideas at all?

I noticed a strange thing:

Everyone who got this badge, completed this course in 2012-2013.Could it be that the reason is the version of the browser? Is it even possible to complete this course in general, if i will try to use an older version of the browser?

I would be grateful to anyone who can help to shed light on the issue!

Thanks,
Mark


#11

Think you must be right, the code I have already passed with is not passing the exercise anymore.
I can't figure out a workaround either, sorry! Your code is of course correct though.


#12

Doesn't work in FF or Chrome. The SCT is broken. We will need someone who knows how to create workarounds. Suggest invite @ionatan and @appylpye.


#13

Where is that text coming from?
"Make sure you have defined all the variables!"
It's not in the submission test and I don't see it in the page source either, but I'm not at all good at digging through that


#14

I couldn't find it either, but then that's nothing new.


#15

It is also possible to try downgrading of the browser version as last resort:

Google Chrome:

Mozilla Firefox:

Opera:

Release history:


#16

Is that more than just speculation?

Anyway, I passed it by other means:

http://storage1.static.itmages.com/i/16/1006/h_1475785679_2094489_f00c034810.png

Add a breakpoint where the console reports an error and switch out the error value with undefined
..editing it allows for clicking through the whole thing :innocent:


#17

Hello Jonatan,

it's amazing and unbelievable! :smile: I don't know how to express my gratitute towards you for your help! This is truly great! :slight_smile:

I'm not too familiar with the developer tools, it can be said that I am an noob... Could you please tell me step by step what I need to do? It will be for me as a good opportunity to see how it works.

Thanks a lot,
Mark


#18

That pretty much was step by step, there weren't very many of them. Run the exercise and follow the exception that's reported in the console


#19

Finally it happened!!!

@ionatan , may god grant you health, you are a lucid mind!! :slight_smile:
@mtf, @alexcraig: Thanks for your help and assistance! Have a nice day! :wink:


#20

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.