Построение кораблика
Категория: Delphi/Pascal
2012-03-15 21:00:29
code: #pascal
uses graph,crt; var gd,gm:integer; a,h:real; begin initgraph(gd,gm,'c:\bp\bgi'); outtextxy (30,0,'Введите высоту и длину палубы (H и A через Enter)'); readln(h); readln(a); LINE (320 + round(a / 2), 240 - round(h / 2),320 + round(a/2), 240 + round(h/ 2)); LINE (320 + round(a / 2), 240 - round(h / 2),320 - round(a / 2), 240 - round(h / 2)); LINE (320 - round(a / 4), 240 + round(h / 2),320 + round(a / 2), 240 + round(h / 2)); LINE (320 - round(a / 4), 240 + round(h / 2),320 - round(a / 2), 240 - round(h / 2)); LINE (320, 240 - round(h / 2),320, 240 - round(h * 2)); LINE (320, 240 - round(h * 2),320 + round(a / 5), round(240 - h)); LINE (320, 240 - round(h),320 + round(a / 5),round( 240 - h)); repeat; until keypressed; closegraph; end.
Поделиться: