Hướng dẫn code pascal tỏ tình

Posted byLanus Coder7 March, 20228 April, 2022Posted inChưa phân loại

Làm việc với đồ họa trong pascal thú vị hơn tôi nghĩ. Tôi đã dành hẳn 1 tuần để nghiên cứu về đồ họa trong Pascal. Chương trình tỏ tình dưới đây là 1 trong số những chương trình tôi tạo ra khi làm việc với đồ họa trong Pascal.

Hướng dẫn code pascal tỏ tình
Hướng dẫn code pascal tỏ tình
Hướng dẫn code pascal tỏ tình
Hướng dẫn code pascal tỏ tình

Video chạy chương trình:

Advertisement

Post navigation

Previous post:
Lập trình Pascal trên điện thoại #2: In ra dòng chữ chạy ngang màn hình

Next post:
Đồ họa trong Pascal #2: Hướng dẫn đổi màu nền toàn bộ màn hình.

Leave a Reply

Enter your comment here...

Fill in your details below or click an icon to log in:

Email (required) (Address never made public)

Name (required)

Website

You are commenting using your WordPress.com account. ( Log Out /  Change )

You are commenting using your Twitter account. ( Log Out /  Change )

You are commenting using your Facebook account. ( Log Out /  Change )

Cancel

Connecting to %s

Notify me of new comments via email.

Notify me of new posts via email.

Δ

uses crt;
type
      str79=string[79];


var s,s2,ban1,ban2:string;
stop:boolean;
n,i:integer;
Procedure heart;
begin
textcolor(lightred);
Writeln('      **       **  *       * *   ');
writeln('    *   *   *     *  *  *     *  ');
Writeln('  *       *        *   *       *  ');
writeln('  *                *           *  ');
writeln('   *               *           *  ');
writeln('    *             *           *   ');
writeln('     *           *          *     ');
writeln('      *        * *        *       ');
writeln('       *     *    *     *         ');
writeln('        *  *       *  *           ');
writeln('         *          *             ');
end;
Procedure load(t:integer); {thoi gian load(so giay), cho oai thoi chu chang
chuc nang j ca hj` hj`}
var i:integer;
  begin
   Write('Loading');
   for i:=1 to 10 do
     begin
     write('.');
     delay(t*100); {vi thoi gian cua ham delay la mili giay nen...tu => ra nhe'}
     end;
  write('100% Done!');
  clrscr;
end;
Procedure Cangiua(var s:str79);
 var i,n:integer;
   begin
    n:=length(s);
    n:=(80-n) div 2;
    for i:=1 to n do s:=' '+s;
   end;
Procedure chu_chay(s:str79; var s2:str79);
 var i,n:integer;
   begin
    s2:=copy(s,2,length(s)-1)+s[1];
   end;
Procedure chucmung(x,y:integer);
  begin
   Gotoxy(x,y); Writeln('_._');
   gotoxy(x,y+1);Write  ('/ \');

   delay(300);
   Gotoxy(x+4,y); write('\./');
   Gotoxy(x+4,y+1); write('/ \');
  end;



begin clrscr;
Write('Nhap ten ban: '); Readln(ban1);
Write('Nhap ten nguoi ay hjhj: '); Readln(ban2);
Ban1[1]:=upcase(ban1[1]);
Ban2[1]:=upcase(ban2[1]);
S:=ban1+' want to say: I LOVE '+ban2;
load(5);
clrscr;
cangiua(s);
stop:=false;
i:=1;
textcolor(darkgray);
While i<=20 do
 begin
 delay(300);
 gotoxy(1,1);
 chu_chay(s,s2);
s:=s2;
write(s);
i:=i+1;
writeln;
 end;
heart;
i:=1; s:='';

   gotoxy(7,5);
   textcolor(lightblue);
For i:=1 to length(ban1) do
  begin
   delay(300);

   Write(ban1[i]);

  end;

   gotoxy(23,5);
   Textcolor(yellow);

for i:=1 to length(ban2) do
  begin
   delay(300);

   write(ban2[i]);

  end;
gotoxy(1,15);
n:=1; i:=15;
  chucmung(n,i); chucmung(n+8,i); chucmung(n+16,i);
 stop:=keypressed;
 writeln;
 Write('           Code by Wind_NarSas(Ta Quang Phong'); {cho nay ban sua cung duoc de the hien vs ban minh hjhj}
 
 if stop then exit;


   readln;
end.