Yama Habib's Webpage

CS 001 LEJOS Mindstorms Project


My code for test maze
My code for actual maze

Flat out, this was the most difficult, time consuming, and stressful thing I have ever done in my life. Our initial robot design--"M.F. Rex" was useless. It couldn't move. All it did was dance. So, in order to fix the situation we designed a better model "M.F. Rex v2". It walked very slowly, and continued to slow down until it reached a point at which it was moving in place, then began to walk backwards, until the cycle reversed. After this we decided to scrap the Alpha Rex-based design altogether. Long story short, 6 designs later, we had a model that was mildly satisfactory and we decided to stick with that.

The code was literally finished last-minute with zero time for debugging. Quite literally, the final version of MazeNavi.java was successfully compiled and tested for the first time on 11:12 AM on the friday of presentations. It couldn't be helped. The code was around 600 lines long and I wrote it all at home in JGrasp without being able to even so much as compile and check for syntax errors. The reason I didn't have my final code until the last day was because I literally had to drastically overhaul/revise it EVERY TIME I tested it. Not only that, but it took so long to finally complete our design that we had just under a week to debug the code--before discovering that we needed to completely overhaul it.

Point being, the day of presentations I got my robot to go from start to finish and back successfully for the first time ever. Unfortunately for some odd reason, the debugging displayed on the LCD wasn't matching up with the robot's actions. It would read "RED" where it should have read "WHITE" which doesn't matter so much...that's just the result of an overly high RGB threshold. What bothered me is that it would skip every other red square and keep going as if it didn't exist. How it still got to finish and back is beyond me, but when it came to the ACTUAL maze, my luck ran out.

(skipping a sad point in this story)So one day, as I was waking up from a good night's sleep (the first I'd had in a while)...it hit me. One line of code. A simple "moveForward(false)" method call where it shouldn't have been. I even pinpointed the exact line number in my head. It made me want to tear out my hair. A friend convinced me though, that it's better to fail and know what you did wrong than to just remain ignorant so that you can fail again.

As a sort of reminder of this painful experience, I never removed the bad line of code from my program. I highlighted it in the text file(s) above.

Despite the fact that I'd have rather done yoga on a bed of heated nails than this assignment, I feel like I've earned alot from it, and that every painful experience makes me a better programmer.