Ok guys so i have a project to do for my c++ class and its supposed to be about two ships (one the player, the other one the computer) and they are on a 10x10 plane created by an array. I did the plane, now how do i get the ships on to their starting positions on the plane? I am really frustrated with this, please help!
This is what i have:
Ok shredded, you are the most helpful person today, thank you so much :D I was getting depressed because i was so stumped on this.
Anyways, this is what i have from the help you gave me, i made the computer to come out as well, i having a small problem though, there seems to be an outlying asterisk that prints out to the right of the board and its random it seems, what could that be?
Also, im supposed to make the player move his ship (up, left, right, NOT down), and when they move, the screen is supposed to refresh and re-draw he board with the moved ships. The computer's ship is supposed to move randomly though, the player doesn't control it.
first the error from the extra asterisk is caused by the second <if> in printBoard just change it to an <else if> ( you might want to test if both players are on the same square as well.)
Ive also modified main function for keyboard input, youll see that i have only included the up key <w> and one case for the computer random movement.