Find Your Hat Challenge Project (JavaScript)

This is my solution :smiley: !
I would appreciate some feedback

Alright, I am sorry to say this but the project is so out of place from the course flow. It most definitely had to be a step-by-step project, due to the fact that there was a huge gap between lessons on the Class and this. I am feeling somewhat envious, that some people could actually get this…idk may be they are doing same challenge not on ‘Beginner’ course?
But yeah, this is hard for a total beginner level.


Thank you very much! I am glad you noticed and liked the description! It is definitely a whole different side of programming for me, a thing that has to be done and that makes lives easier down the road. Appreciate the feedback!

Hi everyone,
Here is my solution.
GitHub: find-fish-game
I’ve placed two gif animations(demo-screen) on the README file so a visitor can take a look at how my game looks.

I’ve modified the find-hat-game to find-‘fish’-game. Especially, I changed the rule ‘out of bounds is game over’ to 'when out of bounds, player wrap-around on the field. ’

This project was pretty difficult for me at the beginning. That means I recognize I’m hard to coding from zero yet. But it was fun to build the game and to modify it!
Any feedback is welcome!

Hi everybody,

I am 33% of the way through the ‘Full Stack Engineer’ course. I had fun completing this project, as I enjoy working with JavaScript. I added the ability for the user to choose a difficulty level - easy, medium, or hard. ‘Easy’ mode generates a 10 x 10 maze, ‘medium’ mode generates a 15 x 15 maze, and ‘hard’ mode generates a 25 x 25 maze.

Here is the link to my code: GitHub - chris-larham-1983/node-terminal-game

Any feedback would be greatly appreciated :slight_smile:

1 Like

Find Your Hat

Here’s my project for the Find Your Hat Challenge.
Let me know what you think!

The idea to replace ‘out of bounds is game over’ with ‘wrap around on out of bounds’ functionality is VERY clever. This will really help to ensure that each randomly-generated maze is able to be completed, as it increases the number of game squares to which the user can move.

Great idea, well done :slight_smile:

1 Like

if -if else- statement is order this way in runGame() , it throws an error when out of bound. Any reason why?? thanks
let play = true;
while (play) {
if (this.isHat()) {
play = false;
} else if (this.isHole()) {
console.log(“Game Over! you fell in the hole”);
play = false;
} if else (!this.isInBound()) {
console.log(“Game Over! you went out of the field”);
play = false;
// update pathcharachter location
this.field[this.y][this.x] = pathCharacter;

Hey, I finished the required part of the project but I really want to create the maze solver too! Does anybody here have some useful resources to lear how to build such a thing?

This is my current code. Works fine for the required tasks, but the maze solver is a mess!

@chrislarham, really thanks for commenting on my post!
I’m glad you agree with my idea. By changing the rule like that, I thought players can try various fields and think more about how to solve :slight_smile:
I think your find-hat-game has a sophisticated display and is well organized!

1 Like

Really enjoyed this exercise, it was quite challenging to begin but once I got in the flow it was very enjoyable.

Here is my code. There are a few more things I could’ve added but overall happy with the outcome

This certainly taxed my brain, but once I got over some of the hurdles ( mainly around arrays ) I rather enjoyed it and can’t wait to enhance it further in the future when I find time outside the course.

Took me two days but I finally managed to do it.
Find your hat

Hi guys,

This is my solution.

I have added another way that you can also move backward after every turn.
Also the started path will be random throughout the field.

Let me know your thought.

I’m happy it helped!

Hi all,

Here is my solution:


This was a fun challenge. However, this took me hours to finish.

I intend to extend this project in the near future to hopefully increase difficulty or validate if the map can actually be solved.

Don’t worry, I hadn’t a clue where to start! I had to pull up the answers in this Forum and just by looking at the answers and what I was expected to do, well, I was completely baffled as to why this was going to be SO hard for me!
It’s like CodeCademy gives you little tasks to complete in the lead up, then throws you in at the deep end expecting you know how to code already! why?! I’m having to do a secondary JavaScript course with Udemy videos to try to reduce a gear and start learning from scratch again!

Hi All,

Here is my attempt at this project. I have not set it up to verify is the field is solvable, but plan to soon.

Thanks for checking it out.

I agree. I have attempted and abandoned this project for 4 days. Looking at solutions is not even helping me. I would have appreciated a step-by-step project or at least a youtube video solution like other projects have provided.
Have you been able to complete the project? I need serious help.