Find Your Hat Challenge Project (JavaScript)

Hello All,

Here is a link to a GitHub Gist, its a completed version of the game. There is plenty of commenting to convey what is going on: CodeCademy: Find Your Hat terminal game · GitHub

1 Like


I have just finished the Find Your Hat project as part of the Back-End Engineering path.

It took me longer than expected and I got a good insight into debugging. After I created the method to randomly generate a field of play, things went wrong! I resolved the issues using a lot of console.log statements on the code until I could find the bugs.

Project below. Thanks!

1 Like

Great work on solving this project!

You could try to use switch inside updateBoard(move) to clean up code. Otherwise great solution!

switch (expression) {
    case value1:
    case value2:
    case value3:
1 Like


This was a great challenge - learned a lot. Much preferred over step by step projects, that IMHO don’t force me to learn as much.
Here is my solution, feel free to comment. Thank You!

Find You Hat challenge solution

1 Like

Soo … like others I found the instructions for this quite vague - did not know where to even start. Got stuck at Step 4. I ended up going to the solutions to understand what was required. which ended up being the same for the rest of the steps. In the end my code just looks like the solution so no point posting that. Onward and upward!