• How to create the board so it is easy to read, and not overly complex.
(Everything that I have been able to come up with is to complex to recreate)
• What kind of array would be best to use to create the board yo keep track of where the ships are, and what spaces have been taken.
• How do you check the array the figure what is there.
I am so confused on how to go about this, so any advice would be appreciated.
The next thing to do is take out a pencil and pad of paper. Write out the requirements. Then pick a requirement and write it out in detail - exactly what is required to achieve the requirement - in English (or your native tongue). Break it down into sub-tasks, and then steps. Try to be as specific as possible.
Then repeat the above for each of the requirements in the application. Before you write code you should have a pretty concise outline of everything you plan to do. Then you pick one task in one requirement and translate it to code - compile it, make sure it runs. Then progress to the next step. The simpler the steps you make the easier it is to get started, the better direction you will have and the sooner you will finish. But the key is analizing the problem up front and making sure you have a plan before you start to code.
Andy Hammersmith wrote:I shall try the second option, but sadly my teacher refuse to give me anymore details on it, so I'm kinda stuck on that part.
And thank you very much for your advice.
Another tip for you: try and separate the game from it's display as much as you possibly can.
I'd suggest that you get it working just using console input and output first, even it it looks a bit clunky; and only add Swing code (if that's a requirement) after you know that the game part works.
And even then, try to keep your Swing code completely separate from your game logic.
What kind of array would be best to use to create the board yo keep track of where the ships are, and what spaces have been taken.
Well, I assume you're familiar with how to create a 2D array or grid. My advice would be to create a small class called Square or Position and allow it to contain a Ship (or not), and then set up a grid of those. You might also find it useful if each Square knows its own position (but it's not essential), and a useful class for storing 2D positions is Point.