уменьшить количество строк в коде язык программирования Паскаль оставив принцип роботы уже уменьшил с 486 до 255 либо подскажите как уменьшить количество строк
program krestiki_noliki;
uses
Crt, Graph;
var
g, key, i, s: Integer;
mas: array [1..9] of Integer;
procedure field;
begin
bar(100, 100, 620, 620);
bar(100, 273, 620, 446);
bar(273, 100, 446, 620);
end;
procedure reset;
begin
key := 2;
delay(1000);
cleardevice;
key := 0;
for i := 1 to 9 do
mas[i] := 0;
field
end;
procedure draw;
begin
for i := 1 to 9 do
s := s + mas[i];
if s = 13 then
begin
key := 2;
delay(1000);
reset;
end ;
end;
begin
InitGraph(detect, detect, '');
field;
while true do
begin
while key = 0 do
begin
g := readKey;
if (g = '1') and (mas[1] = 0) then
begin
line(130, 130, 243, 243);
line(243, 130, 130, 243);
key := 1;
mas[1] := 1;
end
else if (g = '2') and (mas[2] = 0) then
begin
line(303, 130, 416, 243);
line(416, 130, 303, 243);
key := 1;
mas[2] := 1;
end
else if (g = '3') and (mas[3] = 0) then
begin
line(476, 130, 590, 243);
line(590, 130, 476, 243);
key := 1;
mas[3] := 1;
end
else if (g = '4') and (mas[4] = 0) then
begin
line(130, 303, 243, 416);
line(243, 303, 130, 416);
key := 1;
mas[4] := 1;
end
else if (g = '5') and (mas[5] = 0) then
begin
line(303, 303, 416, 416);
line(416, 303, 303, 416);
key := 1;
mas[5] := 1;
end
else if (g = '6') and (mas[6] = 0) then
begin
line(476, 303, 590, 416);
line(590, 303, 476, 416);
key := 1;
mas[6] := 1;
end
else if (g = '7') and (mas[7] = 0) then
begin
line(130, 476, 243, 590);
line(243, 476, 130, 590);
key := 1;
mas[7] := 1;
end
else if (g = '8') and (mas[8] = 0) then
begin
line(303, 476, 416, 590);
line(416, 476, 303, 590);
key := 1;
mas[8] := 1;
end
else if (g = '9') and (mas[9] = 0) then
begin
line(476, 476, 590, 590);
line(590, 476, 476, 590);
key := 1;
mas[9] := 1;
end ;
s := 0;
if (mas[1] = 1) and (mas[2] = 1) and (mas[3] = 1) then
begin
line(130, 186, 590, 186);
reset;
end
else if (mas[4] = 1) and (mas[5] = 1) and (mas[6] = 1) then
begin
line(130, 359, 590, 359);
reset;
end
else if (mas[7] = 1) and (mas[8] = 1) and (mas[9] = 1) then
begin
line(130, 532, 590, 532);
reset;
end
else if (mas[1] = 1) and (mas[4] = 1) and (mas[7] = 1) then
begin
line(186, 130, 186, 590);
reset;
end
else if (mas[2] = 1) and (mas[5] = 1) and (mas[8] = 1) then
begin
line(359, 130, 359, 590);
reset;
end
else if (mas[3] = 1) and (mas[6] = 1) and (mas[9] = 1) then
begin
line(532, 130, 532, 590);
reset;
end
else if (mas[1] = 1) and (mas[5] = 1) and (mas[9] = 1) then
begin
line(130, 130, 590, 590);
reset;
end
else if (mas[3] = 1) and (mas[5] = 1) and (mas[7] = 1) then
begin
line(590, 130, 130, 590);
reset;
end ;
draw;
end;
while key = 1 do
begin
g := readkey;
if (g = '1') and (mas[1] = 0) then
begin
arc(186, 186, 0, 360, 56);
key := 0;
mas[1] := 2;
end
else if (g = '2') and (mas[2] = 0) then
begin
arc(359, 186, 0, 360, 56);
key := 0;
mas[2] := 2;
end
else if (g = '3') and (mas[3] = 0) then
begin
arc(532, 186, 0, 360, 56);
key := 0;
mas[3] := 2;
end
else if (g = '4') and (mas[4] = 0) then
begin
arc(186, 359, 0, 360, 56);
key := 0;
mas[4] := 2;
end
else if (g = '5') and (mas[5] = 0) then
begin
arc(359, 359, 0, 360, 56);
key := 0;
mas[5] := 2;
end
else if (g = '6') and (mas[6] = 0) then
begin
arc(532, 359, 0, 360, 56);
key := 0;
mas[6] := 2;
end
else if (g = '7') and (mas[7] = 0) then
begin
arc(186, 532, 0, 360, 56);
key := 0;
mas[7] := 2;
end
else if (g = '8') and (mas[8] = 0) then
begin
arc(359, 532, 0, 360, 56);
key := 0;
mas[8] := 2;
end
else if (g = '9') and (mas[9] = 0) then
begin
arc(532, 532, 0, 360, 56);
key := 0;
mas[9] := 2;
end ;
if (mas[1] = 2) and (mas[2] = 2) and (mas[3] = 2) then
begin
line(130, 186, 590, 186);
reset;
end
else if (mas[4] = 2) and (mas[5] = 2) and (mas[6] = 2) then
begin
line(130, 359, 590, 359);
reset;
end
else if (mas[7] = 2) and (mas[8] = 2) and (mas[9] = 2) then
begin
line(130, 532, 590, 532);
reset;
end
else if (mas[1] = 2) and (mas[4] = 2) and (mas[7] = 2) then
begin
line(186, 130, 186, 590);
reset;
end
else if (mas[2] = 2) and (mas[5] = 2) and (mas[8] = 2) then
begin
line(359, 130, 359, 590);
reset;
end
else if (mas[3] = 2) and (mas[6] = 2) and (mas[9] = 2) then
begin
line(532, 130, 532, 590);
reset;
end
else if (mas[1] = 2) and (mas[5] = 2) and (mas[9] = 2) then
begin
line(130, 130, 590, 590);
reset;
end
else if (mas[7] = 2) and (mas[5] = 2) and (mas[3] = 2) then
begin
line(590, 130, 130, 590);
reset;
end ;
end;
end;
end.
1. 1
2. не даны сами обрывки
3. не даны варианты ответов и фрагменты
4. 3
5. 1
6. 2
7. 3
8. 105000
9. 3
10. 4
11. 2
12. 2
13. 3
14. 4
15. 3
16. 2
17. 3
18. 1
19. 2
20. 3
Объяснение:
8. Дано:
U = 56000 бит/c
t = 15 сек
Найти:
I = ? байт
I = U * t
I = 56000 * 15 = 840000 бит = 105000 байт
17. Нужно перевести числа из 10-ой системы счисления в двоичную и добавляем слева нули, чтобы было 8 разрядов:
64 = 01000000
129 = 10000001
255 = 11111111
32 = 00100000
Соединив, получаем 01000000 10000001 11111111 00100000
20.
U = 128000 бит/c
I = 5 Мбайт = 41943040 бит
Найти:
t = ? мин
t = I/U
t = 41943040/128000 сек = 327,68 сек ≈ 5.5 мин
Остальные задания просто определения, которые нужно запомнить.