I would like to make some batleships, but I don’t know if it is posible to display a 2D array for the playing ground?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
update spot to X when it has been hit, and print again w/o the initializer line
sorry the code came out weird, but it’s basically a nested for loop, each counting to predefined size of game board, can be indexed from 0,SIZE-1
maybe make it a char array and use O and X and then other characters to draw the ships put out, honestly i’d make the ships eight, equals equals and a capital D, but the choice is yours