Go4Expert (http://www.go4expert.com/)
-   Java (http://www.go4expert.com/forums/java/)
-   -   Pathfinding Robot (http://www.go4expert.com/forums/pathfinding-robot-t24604/)

Accendo 18Jan2011 21:55

Pathfinding Robot
Hey there go4expert!

I have been given a piece of coursework and before I go wandering off on my own and messing things up I figured I should best start with a forum of experts.
  • The requirements for the program are to have a "Robot" that moves from one location to another read in from a file, on a 20x20 grid.
  • It can only move forward and turn to look in the directions of NORTH, EAST, SOUTH, WEST.
  • There are also landmarks stored in another file, record the ones I pass over
  • Then print out how far the robot moved.

Upgrades (Not necessary for a pass)
  • Graphics using swing.
  • Being able to rotate in any direction of 360 degrees.
  • Still print out how far the robot moved but now it's not as simple as I'd need to use trig. now.

I am a big newbie to programming as a whole, only the basic things I have done through uni I know and I would like any input you guys could give me on how best to start this bad boy of an assignment.

Kind regards,

virxen 21Jan2011 05:29

Re: Pathfinding Robot
a schema to start
1) you need code to read from a file
2)create an 2d array 20x20 of integers make all elements -1;
3)create a class Landmarks
4)create an ArrayList of Landmarks objects filled from the data of the file with the
5)add landmarks into the grid (store position inside the arrayList into the 20x20 grid)

p.s. if you have any of the files mentioned, post it to see its structure

post your code to help you more.

useful links

Accendo 21Jan2011 06:07

Re: Pathfinding Robot
Hey there I got to work promptly after this message and am now a little further on and it's scary how similiar what you said is to what I already had :D.

Please look out for my posts encase I get stuck :P.


All times are GMT +5.5. The time now is 09:19.