Homework 1 (Karel the Robot) FAQ

This document is a work in progress and will be updated as more questions are asked by students this quarter.

Q: You said I need to use Eclipse to write my homework, but I prefer a different editor. Can I use my favorite editor instead of Eclipse?
A: Probably not. We don't support this. We are giving you out a starter project in Eclipse's format, so if you were trying to use a different editor, you'd have to reconfigure it into your editor's format, which might be difficult. Also, if you have any problems getting things to work in your editor, we will not be willing to help you fix them.
Q: I'm having trouble getting Eclipse to work! Help!
A: Please make sure you followed the instructions in our Eclipse page. If you are still having trouble, please come to instructor or head TA office hours.
Q: Eclipse is giving me a strange message about a file being "out of sync" with the file system. It says I can press F5 to refresh the file. What does this mean?
A: This happens if you edit/change your file outside of Eclipse. Just press F5 and Eclipse will show you the newest version of the file.
Q: I didn't like the program name, such as CollectNewspaper, so I renamed it to my own name such as DaveIsGreat. That is okay, right?
A: No. For grading purposes, we need you to leave the program names the way we named them.
Q: How do I turn in the assignment? How do I know if my turnin was successful?
A: The submission is built into Eclipse. See the "Submitting Homework" handout in the Handouts page for more details. Check that your submission was successful by viewing it in our Paperless submission system's web page.
Q: The checkerboard problem is hard. Help!
A: Try simplifying the problem. Can you checker a single row or column? Make it work for different row widths or column heights? Okay, now can you make it do two rows? Three? All rows? Etc. Incrementally developing your program in stages by making it solve a smaller simpler problem is a wise strategy for attacking hard programming problems.
Q: The midpoint finder problem is hard. Help!
A: You'll need to be creative. Karel can't directly "count" anything, so he doesn't know the world's size. What geometric tricks can he use to get to the middle without counting? Remember that Karel has an infinite bag of beepers that he can use if so desired, so if you want to drop beepers in certain places to help you make your way around the world, that is totally fine.
Q: The midpoint finder problem was really easy for me. I just used an int variable like we learned about in class in Week 2. I counted the size of the world and then walked Karel half of that distance. That's okay, right?
A: No. The whole reason the midpoint finder problem is challenging is that Karel cannot count. If you can count using variables, the problem becomes much too easy and avoids the kinds of algorithmic strategies we want you to practice on HW1. Please restructure your code not to use a variable in this way. Code that does use variables or other untaught Java features will receive a substantial deduction.
Q: Why does my Karel crash immediately when loading a new world, after loading it on a different one where it works fine (without closing the window)?
A: This is often because your program ends with an infinite loop. The code appears to work, but it's still stuck in that loop at the end of the run method. For example, the following loop walks Karel from (1,1) all the way to the right edge, but when he gets there, the loop doesn't stop:
while (leftIsClear()) {
    if (frontIsClear()) {
        move();
    }
}
Q: How do I create my own world for testing, and/or for Problem 5 "AnythingGoes"?
A: You can either edit the existing .w files directly in Eclipse, saving your own world with a new name, or you can use the graphical world editor built into Karel. Just click the "New World" button. See the "Using Eclipse and Karel" handout in the Handouts page for more details.
Q: Why does my Eclipse have a yellow warning about "overriding run from Stanford.karel.Karel" on my run method?
A: You can ignore this. It's suggesting that you use an advanced Java feature called "annotations", but you don't want/need to do that on this assignment.
Q: Why does my Eclipse have a yellow warning about a "serialVersionUID"?
A: You can ignore this. It's suggesting that you use an advanced Java feature that we don't want/need on this assignment.
Q: Will my solution get full credit? Is it written in the style you want? Will I get marked off for this code?
A: In general we cannot answer these kinds of questions. We call this "pre-grading." The section leader/TA/instructor can't look over your entire program for mistakes or tell you exactly what things you will get marked off for; we don't have the resources to provide such a service, and even if we did, we want you to learn how to gain these intuitions on your own. We'll grade you on the guidelines in the homework document, and we can help you with specific issues and questions about your code, but we cannot pre-evaluate your entire program for you or give you advance warning about every possible mistake or violation.
This document and its content are copyright © Marty Stepp, 2014. All rights reserved. Any redistribution, reproduction, transmission, or storage of part or all of the contents in any form is prohibited without the author's expressed written permission.