Can someone answer my question?8

Pages: 12
closed account (LN3RX9L8)
I need help with my program and no one ever replied... can someone give me tips thanks!
What question?
No.
closed account (LN3RX9L8)
@Fredbill30 If you press my profile and go to recent posts the one with no answers
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.
Why would you make us do extra work to find your problem?

If you want us to help you should make it easy for us. Post a link. Fredbill asked you which question and you basically said "find it yourself".

If you're too lazy to do that much.... then I'm going to be too lazy to answer your Q.
Last edited on
I need help with my program and no one ever replied... can someone give me tips thanks!

If people don't reply, keep calm and bump the thread, preferably after you try to make some progress on your own.

Homework assignment threads tend to be boring (to me at least). I much prefer answering C++ and STL related questions.
closed account (3qX21hU5)
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 :(

I vote just ignore this guys posts
Last edited on
...
closed account (LN3RX9L8)
@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.

Thanks to all the people who helped
closed account (3qX21hU5)
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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void place_boats(char boat[][S], const int boatsToPlace, const int firstDemension, const int 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).
Last edited on
You come across as lazy. It might not be fact, however that's the impression you give.
closed account (LN3RX9L8)
@Zereo Well I am not that experienced with programing so I was a bit confused sorry about that but thanks...
closed account (3qX21hU5)
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.
closed account (LN3RX9L8)
Alright thanks
@ Zereo, const int &?
@Zero: Catfish is pointing out that passing primitives by const reference is useless and less optimized than passing primitives by value.
closed account (3qX21hU5)
Hmm interesting never knew that actually. I'll have to look into that more. Anyways changed it back to the way it was.
closed account (LN3RX9L8)
Hey guys I have a quick question
closed account (3qX21hU5)
Sure whats up?
Pages: 12