Java Robots Help

Smells like a uni project... so post what you have come up with yourself first and then we can provide some pointers for you todo your own work :D
 
It's not really a hard problem, come on dude we're not here to do your homework. What specifically is it you have problems with?
 
Are you using the Java: Learning to Program with Robots textbook by Byron Becker? I used Becker's environment a lot in my undergrad dissertation back in the day, got it published as well which was quite cool.

If so then this is a really simple problem. Just break it down and figure out how to solve each step:
1. You need to get four numbers from the user (X and Y coordinates for the robot and goal).
2. You need to figure out what direction you need to move the robot in
3. Turn the robot to face that direction and move one space
4. Repeat 2 and 3 until the robot's location matches the goal's
 
This is a simple problem really, and you should make the most out of it by trying ... else you will never learn to go at it independently!

As Spuds said, robots are very stupid so you need some "performance metric" you will maximise/minimise while looking for the goal. For example, you can sweep the entire grid by going all the way up, then take a right and another right and then come all the way south etc. until you bump onto the goal. This is a greedy approach though but if there are no other clues it is the best bet.

Can your robot see beyond the current cell?

Does your robot know anything about the grid/environment or it is going blind?

AI tries to simulate human intelligence ... just think how YOU would look for the goal and code it .. it is THAT simple really.
 
Back
Top Bottom