3
I have a question about a college job that I have been doing. It consists of creating a naval battle game, in PASCAL. I’m using the contents of this link as a guide to write the program:
http://www.pb.utfpr.edu.br/omero/Pascal/Exercicios/Geral/BATALHA.Htm
The doubt is as follows, as I establish how many positions a particular vessel should occupy on the board?
For example, if I wish to establish that a particular vessel occupies 6 positions on the board I should write this way?
for Conta := 1 to 5 do
begin
repeat
i := random(6);
j := chr(random(9)+65);
until Batalha[i, j] = '0';
Batalha[i, j]:='S';
end;
The command i := random(6);
establishes that a vessel will occupy 6 positions on the board?
Thank you.