|
Problem 3 In this exercise, your job is to get Karel to create a checkerboard pattern of beepers inside an empty rectangular world, as illustrated in the following before-and-after diagram Can anyone tell where did I made mistake ? my code is as follows : public class CheckerboardKarel extends SuperKarel {
} |
|
Bug is fixed but now ...... this program is not working for 3 rows ans 5 columns :( ... same program should work for that too.... public class CheckerboardKarel extends SuperKarel {
} |
|
This is a wonderful opportunity for learning how to logically debug. I would suggest that you draw a 3x5 grid and then manually (by hand) follow your program as Karel moves. Put the beeper where you get the putBeeper() command and make Karel move as the logic of your program decides. This will help you understand where exactly your algorithm is failing. Once you understand that, you can then design a better algorithm. Good Luck :-) |
|
@Zaibunnisa82, you will notice a 'Messages' tab on the top of this page, besides the 'Blog' tab. Just FYI, everytime someone posts an answer to a question you have asked, you will see an '*' sign on the 'Messages' tab. Hope this helps you quickly find out if there is some activity on the forum questions you have asked. |
|
thank you very much .. I ll use the link you mentioned .. and make 3x5 grid to solve this problem manually ... |
- http://twitter.com/Zaibunnisa82 provided an answer for question 'assignment 1: problem no 3 .. course : programming methadologies .. Can anyone guide me ?' ... Feb 12, 2012
- http://twitter.com/coding_insights provided an answer for question 'assignment 1: problem no 3 .. course : programming methadologies .. Can anyone guide me ?' ... Feb 12, 2012
- http://twitter.com/coding_insights provided an answer for question 'Assignments for this course' ... Feb 12, 2012
- http://twitter.com/coding_insights provided an answer for question 'assignment 1: problem no 3 .. course : programming methadologies .. Can anyone guide me ?' ... Feb 12, 2012
- http://twitter.com/Zaibunnisa82 provided an answer for question 'assignment 1: problem no 3 .. course : programming methadologies .. Can anyone guide me ?' ... Feb 11, 2012
- http://twitter.com/Zaibunnisa82 provided an answer for question 'Assignments for this course' ... Feb 11, 2012
- http://twitter.com/Zaibunnisa82 asked a new question 'assignment 1: problem no 3 .. course : programming methadologies .. Can anyone guide me ?' ... Feb 11, 2012
- http://twitter.com/Zaibunnisa82 provided an answer for question 'For loop' ... Feb 11, 2012
- http://twitter.com/coding_insights provided an answer for question 'For loop' ... Feb 10, 2012
- http://twitter.com/coding_insights provided an answer for question 'For loop' ... Feb 10, 2012
- http://twitter.com/Zaibunnisa82 asked a new question 'For loop' ... Feb 9, 2012
- http://twitter.com/coding_insights asked a new question 'Assignments for this course' ... Nov 21, 2011
