answersLogoWhite

0

first you have to initialize the array.

board : Array [1..10,1..10] of char;

then place the ships

board[2,2]:='A';

board[3,2]:='A';

board[4,2]:='A';

board[5,2]:='A';

board[6,2]:='A';

i would advise to use some simple coding for the ships such as

aircraft carrier code: A

so if aircraft carrier is at

[2,5] to [6,5], you can ask the user to enter two numbers (row, column) and check if

e.g. point [4,5] is assigned to 'A'

this is the coding i used for aircraft carrier, which is pretty much the same for all

while Gcount <> 17 do //5+4+3+3+2

begin

count:= count+1; // to count how many hits were required at the end

writeln('enter row you want to hit');

readln(row);

writeln('enter column you want to hit');

readln(col);

if board [row,col] = 'A' then

begin

Gcount:=Gcount+1;

writeln('you hit AirCraft Carrier');

end

else if board [row,col] = 'B' then

.... and so on....

i did not copy the exact code i used since there is a slight error. you can hit the same spot twice...

but in general to make such a game is not very hard

regards, Gohan (CY)

User Avatar

Wiki User

17y ago

What else can I help you with?

Related Questions

Make a pascal using c plus plus?

Please make your question more clear. Qhat do you want to do? Rewrite the programming language Pascal? Convert c++ code to Pascal? Create a Pascal triangle? Make a baby son that's called Pascal? (btw, that last thing has to be done in hardware)


How do you make a memory card game on turbo pascal?

you cant u stupid


How did pascal make pascal's triangle?

pascal drew a triangle, and then signed his name at the bottom of the page. He was 7 years old


Where do you make a flash game?

Open flash. Make a game using AS.


How to make your own game?

You can make your own game using Sploder. A similar service is Game Gonzo.


When did Blaise Pascal make his contributions?

1891


When did Pascal Blaise make his invention?

1642 - 1645


How make a sentence using after the football game?

After the football game i had a huge party.


Can you make sentences using a cakewalk?

This game was a cakewalk


Did Blaise Pascal make Harry Potter?

No, but he was a wizard at math.


What is the most effective battleship game strategy for winning consistently?

The most effective battleship game strategy for winning consistently is to start by spreading out your ships across the board to make it harder for your opponent to guess their locations. Then, focus on targeting areas where you haven't hit any ships yet to increase your chances of finding and sinking your opponent's ships. Additionally, pay attention to your opponent's patterns and adjust your strategy accordingly to outsmart them.


How do you make a game using mesh in Scratch or BYOB?

hgfhfgh