Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Java (http://www.programmingforums.org/forum17.html)
-   -   Help Me Please (http://www.programmingforums.org/showthread.php?t=1373)

ram2 Dec 1st, 2004 12:06 PM

Hi,
I have recently begun studying computer science in Cork, Ireland.We are using karel the robot at the moment to introduce us to programming.I have a problem and can not crack it and I am
just wondering could anyone that is familiar with Karel the Robot help me out.

THE PROBLEM:

Write a robot program to find the closest beeper ( to the north, South,East, or West of the robot),
and carry it back to the starting corner, facing towards the former location of the beeper.

create a new class of robot, a `Retriever` , to assist in performing this task. this class should have a method with heading:
public void retrieveClosestBeeper( )
which retrieves the closest beeper. it may also have other appropriate private methods.

The program may make the following assumptions:
1) There is a beeper somewhere to to the north, south, east or west of the starting corner;
however, there needv not necessarily be beepers in all four directions.
2) there is no beeper at the staring corner.
3) There are no walls which are closer to the starting corner than the closest beeper.

ANY HELP WOULD BE GREATLY APPRECIATED.
THANK YOU,
ROSS ( ram2@student.cs.ucc.ie )

Pizentios Dec 1st, 2004 12:27 PM

What language are you using?

Infinite Recursion Dec 1st, 2004 4:18 PM

He's probably using Java.

There is some C++ source code posted for the same thing but it is "Rat and Cheese" objects. You could easily derive a Java program from their C++ code, check out the C++ forum for it.

Mjordan2nd Dec 1st, 2004 6:42 PM

http://www.programmingforums.org/forum/ind...p?showtopic=596

Infinite Recursion Dec 1st, 2004 11:54 PM

That link is right on the money... I thought it was in the C++ forum, obviously because I wrote code for it in C++ and not Java... failed to look at the forum name first... then just got carried away with the C++ version.


All times are GMT -5. The time now is 2:56 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC