Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 1st, 2004, 11:06 AM   #1
ram2
Newbie
 
Join Date: Dec 2004
Posts: 1
Rep Power: 0 ram2 is on a distinguished road
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 )
ram2 is offline   Reply With Quote
Old Dec 1st, 2004, 11:27 AM   #2
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
What language are you using?
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Old Dec 1st, 2004, 3:18 PM   #3
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
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.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Dec 1st, 2004, 5:42 PM   #4
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
http://www.programmingforums.org/forum/ind...p?showtopic=596
__________________
&quot;Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children.&quot; - Dwight D. Eisenhower
Mjordan2nd is offline   Reply With Quote
Old Dec 1st, 2004, 10:54 PM   #5
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
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.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:23 PM.

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