Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialRandy Hoyt
Treehouse Guest TeacherNew Workshop: More JavaScript Maze
I'm happy to announce that we launched the thrilling conclusion (part two) of my object-oriented JavaScript workshop for Gold members yesterday. In this workshop, I walk step-by-step through how I would solve the following programming problem:
Write a computer program that represents a robot
in a maze and leads him to the exit.
Here's a link to both parts, along with the full description for part two:
After you learn the basic building blocks of a programming language, there's still a lot to learn about when to use each one and how to make them all work together. In this workshop, Randy will walk you step-by-step through solving a programming problem. You'll get to listen in on discussions between Treehouse teachers, gaining insight into how programmers think and work. In Part 2, Randy and Andrew discuss the solution to the problem at a high level, and then Randy uses the robot and maze model to hammer out the details of the algorithm. You'll discover ways to improve your own workflow and code — whatever language you're working in.
5 Answers
John Wheal
27,969 PointsI have found this so useful. Any more videos like this would be great!
Randy Hoyt
Treehouse Guest TeacherGlad to hear it, John! :~)
You ask for more videos "like this": would you mind explaining a little bit what exactly you'd like to see more of?
James Barnett
39,199 Points@John - If you want to work on some JavaScript projects like Hangman & Minesweeper check out CodeGarage's JavaScript projects
John Wheal
27,969 Points@Randy I am talking about videos that show you solving semi-complex problems and thinking about the algorithms.
Randy Hoyt
Treehouse Guest Teacher@John - Got it! I'll be sure to pass that feedback along; I'd love to make more tutorials like this one.
Kostas Oreopoulos
15,184 PointsKostas Oreopoulos
15,184 PointsBasically the algorithm could be a tad simpler. When you want to follow a left wall, you simple do (in meta-algorithm) function solveMaze() if(canGoLeft()) turnLeft() ; return "left"; if(canGoForward()) goForward();return "forward" ; if (canGoRight()) go Right(); return "right"; turnBack();return "back";
you can now even accumulate the returns into an array (named solution) and have it in a humanly readable format
So basically you just prioritize your movements (left,forward,right,back) , which is much simpler to follow