Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > Delphi программирование > Паскаль, Turbo Pascal, PascalABC.NET
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 19.03.2017, 20:21   #1
Halikarnas
Пользователь
 
Регистрация: 19.03.2017
Сообщений: 14
По умолчанию Помогите переделать код с Turbo Pascal на PascalABC.NET.

Помогите переделать код с Turbo Pascal на PascalABC.NET
Код:
uses graphabc, crt;
var gd, gm: integer;
i: byte;
ch: char;
procedure zap;
const
x0 = 320;
h = 0.1;
m = 10;
y0 = 240;
h1 = 5;
var gd, gm: integer;
x, y, a, a1, b, b1, c, c1: real;
i: integer;
x1, y1, x2, y2: longint;
function f(x: real): real;
begin
a := a1 * 20;
f := a * sqr(x) + b * x + c;
end;
begin clrscr;
gd := detect;
initgraph(gd, gm, '');
setcolor(14);
setbkcolor(1);
settextstyle(7, 0, 5);
outtextxy(200, 140, 'Wvedit a,b,c');
readln(a1, b, c);
cleardevice;
settextstyle(7, 0, 2);
line(0, 240, 640, 240);outtextxy(308, 210, '1');
line(320, 0, 320, 480);outtextxy(330, 238, '1');
outtextxy(308, 238, '0');
line(330, 239, 330, 241);
outtextxy(620, 238, 'x');
outtextxy(300, 0, 'y');
line(319, 230, 321, 230);
x := 0;
x2 := x0 + trunc(m * x);
y := f(x);
y2 := y0 - trunc(m * y);
moveto(x2, y2);
setcolor(14);
for i := 1 to 40 do
begin
y := f(x);
y2 := y0 - trunc(m * y);
lineto(x2, y2);
x2 := x2 - h1;
x := x - h;
end;
x := 0;
x2 := x0 + trunc(m * x);
y := f(x);
y2 := y0 - trunc(m * y);
moveto(x2, y2);
setcolor(14);
for i := 1 to 40 do
begin
y := f(x);
y2 := y0 - trunc(m * y);
lineto(x2, y2);
x2 := x2 + h1;
x := x + h;
end;
readln;
end;
procedure ins;
begin clrscr;
cleardevice;
setcolor(9);
rectangle(2, 2, 638, 478);
rectangle(4, 4, 636, 476);
setcolor(14);
settextstyle(1, 0, 1);
outtextxy(20, 10, 'Eto super programa, dlya graficheskogo reshenya kvadratnuh');
outtextxy(15, 30, 'yrovneniy ;)');
readln;
end;
procedure izd;
begin clrscr;
cleardevice;
setcolor(10);
rectangle(4, 4, 636, 476);{ramka}
rectangle(2, 2, 638, 478);{ramka}
setfillstyle(1, 6);
bar(5, 240, 635, 475);{stil}
setfillstyle(1, 13);
bar(5, 5, 635, 239);{stena}
setfillstyle(1, 8);
bar(40, 15, 400, 315);{verhnya krishka}
setfillstyle(1, 0);
bar(50, 30, 390, 300);{ekran}
setcolor(7);
line(40, 315, 15, 465);{nignya krishka}
line(15, 465, 425, 465);{nignya krishka}
line(425, 465, 400, 315);{nignya krishka}
line(40, 315, 400, 315);{nignya krishka}
setfillstyle(1, 7);
floodfill(20, 460, 7); {zalivka niz}
setcolor(8);
rectangle(185, 430, 225, 460);{mishka}
line(185, 452, 225, 452);{mishka}
line(205, 452, 205, 460);{mishka}
setfillstyle(1, 0);
floodfill(200, 450, 8); {mishka}
setcolor(8);
line(50, 325, 34, 425);{kontyr klaviatyru}
line(34, 425, 406, 425);{kontyr klaviatyru}
line(410, 443, 390, 325);{kontyr klaviatyru}
line(390, 325, 50, 325);{kontyr klaviatyru}
line(410, 443, 344, 443);{nignya liniya}
line(344, 443, 340, 407);
line(38, 407, 404, 407);{poperechna liniya}
line(40, 389, 401, 389);{poperechna liniya}
line(42, 371, 353, 371);{poperechna liniya}
line(45, 353, 395, 353);{poperechna liniya}
line(48, 335, 392, 335);{poperechna liniya}
line(372, 325, 391, 443);
line(366, 443, 361, 407);
line(380, 371, 398, 371);{poperechna liniya}
line(334, 407, 332, 389);
line(355, 389, 353, 371);{enter}
line(345, 371, 343, 353);{enter}
line(55, 425, 57, 407);
line(77, 425, 79, 407);
line(99, 425, 101, 407);
line(121, 425, 122, 407);
line(143, 425, 144, 407);
line(320, 425, 318, 407);
line(298, 425, 296, 407);
line(276, 425, 275, 407);
line(254, 425, 253, 407);
line(312, 407, 310, 389);
line(290, 407, 288, 389);
line(268, 407, 266, 389);
line(246, 407, 245, 389);
line(224, 407, 223, 389);
line(202, 407, 202, 389);
line(180, 407, 181, 389);
line(158, 407, 159, 389);
line(136, 407, 137, 389);
line(114, 407, 116, 389);
line(92, 407, 94, 389);
line(70, 407, 72, 389);
line(337, 389, 335, 371);
line(315, 389, 313, 371);
line(293, 389, 291, 371);
line(271, 389, 269, 371);
line(249, 389, 248, 371);
line(227, 389, 226, 371);
line(205, 389, 205, 371);
line(183, 389, 184, 371);
line(161, 389, 162, 371);
line(139, 389, 141, 371);
line(117, 389, 119, 371);
line(95, 389, 97, 371);
line(73, 389, 75, 371);
line(323, 371, 321, 353);
line(301, 371, 299, 353);
line(279, 371, 277, 353);
line(257, 371, 255, 353);
line(235, 371, 234, 353);
line(213, 371, 212, 353);
line(191, 371, 192, 353);
line(169, 371, 170, 353);
line(147, 371, 148, 353);
line(125, 371, 127, 353);
line(103, 371, 105, 353);
line(81, 371, 83, 353);
line(59, 371, 62, 353);
line(351, 353, 349, 335);
line(329, 353, 327, 335);
line(307, 353, 305, 335);
line(285, 353, 283, 335);
line(263, 353, 261, 335);
line(241, 353, 240, 335);
line(219, 353, 218, 335);
line(197, 353, 197, 335);
line(175, 353, 176, 335);
line(153, 353, 154, 335);
line(131, 353, 132, 335);
line(109, 353, 111, 335);
line(87, 353, 89, 335);
line(65, 353, 67, 335);
line(350, 335, 348, 325);
line(328, 335, 326, 325);
line(306, 335, 304, 325);
line(284, 335, 282, 325);
line(262, 335, 261, 325);
line(240, 335, 239, 325);
line(218, 335, 217, 325);
line(196, 335, 196, 325);
line(174, 335, 175, 325);
line(152, 335, 153, 325);
line(130, 335, 131, 325);
line(108, 335, 110, 325);
line(86, 335, 88, 325);
line(64, 335, 66, 325);
setcolor(11);
settextstyle(5, 0, 4);
outtextxy(55, 50, 'Wukonav');
setcolor(10);
settextstyle(7, 0, 5);
outtextxy(90, 120, 'Kychenko S.V.');
setcolor(11);
settextstyle(1, 0, 2);
outtextxy(75, 230, 'specialno dlya industrialnogo');
outtextxy(75, 260, 'koledgy');
readln;
end;
procedure endprog;
begin clrscr;
cleardevice;
setcolor(8);
putpixel(100, 240, 15);
ellipse(75, 240, 270, 90, 15, 80);{bokovoi kontur}
ellipse(565, 240, 90, 270, 15, 80);{bokovoi kontur}
ellipse(320, 160, 180, 0, 245, 10);{verhnij kontu}
ellipse(320, 320, 0, 180, 245, 10);{niznij kontur}
ellipse(75, 180, 90, 330, 8, 20);
ellipse(75, 300, 30, 270, 8, 20);
ellipse(565, 180, 210, 90, 8, 20);
ellipse(565, 300, 270, 150, 8, 20);
line(82, 190, 86, 190);{vnytrenniy}
line(82, 290, 86, 290);{vnytrenniy}
line(557, 190, 554, 190);{vnytrenniy}
line(557, 290, 554, 290);{vnytrenniy}
line(75, 200, 88, 200);
line(75, 280, 88, 280);
line(565, 200, 552, 200);
line(565, 280, 552, 280);
setfillstyle(1, 7);
floodfill(320, 240, 8);
floodfill(86, 198, 8);
floodfill(75, 180, 8);
floodfill(86, 282, 8);
floodfill(75, 300, 8);
floodfill(554, 198, 8);
floodfill(565, 180, 8);
floodfill(554, 282, 8);
floodfill(565, 300, 8);
setcolor(11);
rectangle(2, 2, 638, 478);
rectangle(4, 4, 636, 476);
setcolor(9);
settextstyle(7, 0, 4);
outtextxy(95, 180, 'Vu deistvitelno hotite vuiti?');
setcolor(11);
settextstyle(4, 0, 6);
outtextxy(250, 220, 'Y/N');
ch := readkey;if ch = 'y' then halt(0);
end;
procedure menu;
begin
repeat clrscr;
cleardevice;
setcolor(8);
ellipse(319, 79, 180, 0, 160, 2);
ellipse(490, 171, 130, 200, 32, 120);
ellipse(430, 250, 304, 30, 32, 120);
ellipse(297, 319, 180, 1, 160, 2); {kontur niz}
ellipse(297, 351, 0, 180, 160, 2); {kontur niz}
ellipse(447, 335, 25, 270, 5, 15);
line(451, 329, 443, 329);
ellipse(147, 335, 90, 270, 5, 15);
ellipse(470, 95, 270, 90, 5, 15);
line(470, 110, 462, 110);
ellipse(470, 98, 90, 270, 3, 12);
ellipse(470, 96, 0, 90, 2, 10);
line(472, 96, 467, 96);
line(470, 86, 468, 86);
ellipse(190, 171, 130, 200, 32, 120);
ellipse(130, 250, 325, 30, 32, 120);
putpixel(447, 351, 0);
putpixel(147, 351, 0);
setfillstyle(1, 7);
floodfill(200, 100, 8);
floodfill(447, 322, 8);
floodfill(400, 330, 8);
floodfill(470, 82, 8);
floodfill(468, 109, 8);
floodfill(470, 92, 8);
putpixel(468, 87, 7);
putpixel(467, 90, 7);
putpixel(467, 91, 7);
setbkcolor(1);
setcolor(11);
rectangle(2, 2, 638, 478);
rectangle(4, 4, 636, 476);
setcolor(9);
settextstyle(4, 0, 6);
outtextxy(210, 80, 'Menu');
setcolor(11);
settextstyle(1, 0, 2);
outtextxy(200, 150, '1. Zapustit programy');
outtextxy(200, 190, '2. Insyrykciya');
outtextxy(200, 230, '3. O razrobotcheke');
outtextxy(200, 270, '4. Vuhod');
ch := readkey;
case ch of
'1': zap;
'2': ins;
'3': izd;
'4': endprog;
end;
until ch = 'y';
end;
begin clrscr;
gd := detect;
initgraph(gd, gm, '');
i := 0;
menu;
closegraph;
end.
Halikarnas вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск


Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Преобразовать код из Turbo Pascal в PascalABC.NET almazmr Помощь студентам 0 15.01.2017 18:50
Turbo Pascal/Free Pascal/PascalABC.NET как новый инструмент экстрасенсов Biohazard333 Свободное общение 5 25.09.2016 12:25
код программы на языке PascalABC.NET и C# Namatrasnik Помощь студентам 0 04.06.2016 22:02
код программы на языке PascalABC.NET и C# Namatrasnik Помощь студентам 0 04.06.2016 21:59
Портануть код с PascalABC.NET на Java ZoxWatt Помощь студентам 0 31.05.2012 14:52