im makeing a battleship program. how do i randomly place ships on the board?
Type: Posts; User: howardqd
im makeing a battleship program. how do i randomly place ships on the board?
o ok thanks alot. i just wanted to make sure
isnt it simply cin>>numb ?
the whole thing is there and the scaf is if highlighed
#include <iostream>
#include <windows.h>
using namespace std;
int choose(){
int numb;
can someone help me convert this into cout?
scanf( "%d", &numb );
cout << " A B C D E F G H I J K L\n";
cout << "----------------------------\n";
all i want to do is find a way to randomly place ships on the board to that the two player can guess the coordinates. its a simple battleship game
ok and another thing is that im missing the rest of my shoot method but idk how i would write it out im confused
i try to format the code but i guess the forum disables my formatting. i did the corrections that you showed me i feel like a silly one for missing that but now i tried to run it again and it says :...
i did that and now im gettin new error and im just confused now. here my code :
#include <stdio.h>
#include <iostream>
#include <iomanip>
using namespace std;
im sorry for all of that. my compiler didnt have a format option. but i tried to compiled it and i declared choose in the beginning and its giving me these other errors :
In function `void...
i fixed that but im still gettin erros. heres my code
#include <stdio.h>
#include <iostream>
#include <iomanip>
using namespace std;
int main () {
int choose;
im doing a battleship program for my c++ class and i keep gettin these errors when i compile:
line
84 `grid' undeclared (first use this function)
84 `y' undeclared (first use this...