Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int direction;
- int location[12][12];
- int numShips = 5;
- int seed;
- /* incorporate an if statement where the initial seed value is 0 for easy, 1 for normal, 2 for hard, and 3 for insane.
- I don't know how it would work myself*/
- srand(seed);
- for(int i=0; i < numShips; ++i){
- location[(rand() % 100) % 12][(rand() % 50) % 12] = 1;
- cout << (rand() % 100) % 12 << endl;
- cout << (rand() % 50) % 12 << endl;
- direction = rand() % 4;
- cout << direction << endl;// 0=north, 1=east, 2=south, 3=west
- seed = rand() % 500;
- srand(seed);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement