Please do not ask people to help you with your problem in other parts of the forum. I believe that posting you query was int he first place a request for help. If no one helps you it is because:
1) You have annoyed everyone, and no one wants to help you
2) You have not asked your question correctly/clearly
3) The code you posted is too long and no one feels like reading it.
4) No one can help you.
I need help with my program and no one ever replied... can someone give me tips thanks!
Ohh wow tiffany....
@Fredbill30 If you press my profile and go to recent posts the one with no answers
You mean the battleship program that we helped you out with already?
Evidence Dun Dun DUN......
first post (In lounge another post like this one lol)
www.cplusplus.com/forum/lounge/98536/
Second Post where we helped you, and I even gave you most of your function you had problems with. You even thanked us....
www.cplusplus.com/forum/beginner/98576/
So what is with all this no one ever helped me stuff?
Maybe a better title and topic would be I'm to lazy to do my own work and no one will give me the complete code to my program :(
@Zereo no it looks exactly the same but this is a beefed up version of it including 8 boats not just one and that is where I needed help and in other areas... and sorry I did not mean to sound like the person people are saying I am... I went to go get help at school, but the teacher was not so nice, and I come on here and I always seem to get hate...I guess I will just keep it to myself and find another way.
Zereo no it looks exactly the same but this is a beefed up version of it including 8 boats
Here is the function I posted for you the last time you asked. It provides functionality to add as many boats as you want (As long as the array supports that many) the boatsToPlace parameter. So I am not sure how it is any different.
void place_boats(char boat[][S], constint boatsToPlace, constint firstDemension, constint secondDemension)
{
// This will keep track of how many boats have been placed
int boatsPlaced = 0;
srand(time(NULL));
while (boatsPlaced != boatsToPlace) // Determines how many boats to place
{
// Something here. Hint: It involves getting a random number for the multi array index
// Something here. Hint: Same as the above comment
if (boat[i][j] == 'B')
continue;
else
{
boat[i][j] = 'B';
++boatsPlaced;
}
}
}
But anyways no problem, but my advice is instead of keeping asking the same question again and again I would work to understand what we have already gave you ;p
The code above does everything you need it to do (Place 8 boats). Just pass in your array to the first paramter, how many boats to place to the second, the the array's sizes to the 3rd and 4th parameter (Use these sizes to generate the random index's to randomly place a boat on the board).
It shouldn't be to hard for you, that function only uses everything you have already used in your original program so you should know all of what I posted.