There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Jack Wool wrote:I have no idea why or what is going wrong
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
Tim Holloway wrote:I'd just slap a "System.out.println" in the move() method to print a log of its movements, compare the output to expected actions, and THEN use the debugger (if you need to) to see where/how it's going wrong.
Tim Holloway wrote:"Jack Wool" from Australia? Hmmm. Good thing you're not from New Zealand or we'd think you were pulling our chains.
With all due respect to IDEs, what you're attempting to do is track a "turtle" (robot) and ensure that it takes a meaningful course, making the proper decisions and ending up in the appropriate destination.
I'd just slap a "System.out.println" in the move() method to print a log of its movements, compare the output to expected actions, and THEN use the debugger (if you need to) to see where/how it's going wrong.
I realize that the problem definition requires a simplified language that may not include printing a trace, but as long as the diagnostic method isn't presented as part of the problem solution (in other words, delete the trace logic when you're done), I can't see anything wrong with that tactic.
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Don't get me started about those stupid light bulbs. |