|
|
Conținut
Interdependenta.pasuses crt,dos,graph; var i,ex,ey,mx,my:integer; k:char; h,m,sa,ms,s1:word;page:boolean{:=false}; s:record x,y,z,a,b,c:real; end; p,j,l1,l2,c1,c2:boolean; function r(g:real):real; begin r:=g*pi/180; end; function g(r:real):real; begin g:=r*180/pi; end; function hour:string; var sh,sm,ss:string; begin str(h:0,sh);str(m:0,sm);str(sa:0,ss); if length(sh)=1 then sh:='0'+sh; if length(sm)=1 then sm:='0'+sm; if length(ss)=1 then ss:='0'+ss; hour:=sh+':'+sm+':'+ss; end; procedure ChangePage; begin if Page then begin SetActivePage(0); SetVisualPage(1,true); Page:=false; end else begin SetActivePage(1); SetVisualPage(0,true); Page:=true; end; ClearPage; OutTextXY(mx div 2-textwidth(hour)div 2, 1, hour); end; procedure sppl(o:char;x,y:real;var ox,oy:real); var u:real; cuv,v:string; begin case o of 'x':u:=r(s.a); 'y':u:=r(s.b); 'z':u:=r(s.c); end; ox:=x*cos(u)-y*sin(u); oy:=y*cos(u)+x*sin(u); end; procedure linl(x,y:real); var x1,y1:real;cuv:string; begin sppl('z',x,y,x1,y1); {tr(x1:5:2,cuv); outtextxy(10,40,cuv); str(y1:5:2,cuv); outtextxy(10,50,cuv);} {line(ex,ey,ex+round(x1),ey+round(y1)); line(ex,ey,ex-round(x1),ey-round(y1));} if l1 then begin line(ex+round(x1),ey,ex,ey+round(y1)); line(ex-round(x1),ey,ex,ey-round(y1)); end; if l2 then begin line(ex+round(x1),ey,ex,ey-round(y1)); line(ex-round(x1),ey,ex,ey+round(y1)); end; if c2 then begin circle(ex+round(x1/2),ey+round(y1/2),round(sqrt(x1*x1+y1*y1)/2)); circle(ex-round(x1/2),ey-round(y1/2),round(sqrt(x1*x1+y1*y1)/2)); circle(ex+round(x1/2),ey-round(y1/2),round(sqrt(x1*x1+y1*y1)/2)); circle(ex-round(x1/2),ey+round(y1/2),round(sqrt(x1*x1+y1*y1)/2)); end; if c1 then begin circle(ex+round(x1),ey,round(sqrt(x1*x1+y1*y1)/4)); circle(ex-round(x1),ey,round(sqrt(x1*x1+y1*y1)/4)); circle(ex,ey+round(y1),round(sqrt(x1*x1+y1*y1)/4)); circle(ex,ey-round(y1),round(sqrt(x1*x1+y1*y1)/4)); end; if p then begin putpixel(ex+round(x1/2),ey+round(y1/2),round(sqrt(x1*x1+y1*y1)/2)); putpixel(ex-round(x1/2),ey-round(y1/2),round(sqrt(x1*x1+y1*y1)/2)); putpixel(ex+round(x1/2),ey-round(y1/2),round(sqrt(x1*x1+y1*y1)/2)); putpixel(ex-round(x1/2),ey+round(y1/2),round(sqrt(x1*x1+y1*y1)/2)); putpixel(ex+round(x1),ey+round(y1/2),round(sqrt(x1*x1+y1*y1)/2)); putpixel(ex-round(x1),ey-round(y1/2),round(sqrt(x1*x1+y1*y1)/2)); putpixel(ex+round(x1),ey-round(y1/2),round(sqrt(x1*x1+y1*y1)/2)); putpixel(ex-round(x1),ey+round(y1/2),round(sqrt(x1*x1+y1*y1)/2)); putpixel(ex+round(x1/2),ey+round(y1),round(sqrt(x1*x1+y1*y1)/2)); putpixel(ex-round(x1/2),ey-round(y1),round(sqrt(x1*x1+y1*y1)/2)); putpixel(ex+round(x1/2),ey-round(y1),round(sqrt(x1*x1+y1*y1)/2)); putpixel(ex-round(x1/2),ey+round(y1),round(sqrt(x1*x1+y1*y1)/2)); putpixel(ex+round(x1),ey,round(sqrt(x1*x1+y1*y1)/4)); putpixel(ex-round(x1),ey,round(sqrt(x1*x1+y1*y1)/4)); putpixel(ex,ey+round(y1),round(sqrt(x1*x1+y1*y1)/4)); putpixel(ex,ey-round(y1),round(sqrt(x1*x1+y1*y1)/4)); end; if j then begin line(ex+round(x1),ey+round(y1),ex-round(x1),ey-round(y1)); line(ex+round(x1),ey-round(y1),ex-round(x1),ey+round(y1)); end; end; begin SetSVGAMode(640, 480, 8, LfbOrBanked); OutTextXY(270, 230, 'Please wait...'); SetRGBPalette(255, 63, 63, 63); drawborder:=false; page:=true; mx:=getmaxx;my:=getmaxy; ex:=mx div 2;ey:=my div 2; s.a:=0;s.b:=0;s.c:=0; l1:=false;l2:=l1; c1:=true;c2:=c1; p:=c1;j:=l1; repeat s.c:=s.c+1; if s.c>=360 then s.c:=s.c-360; if keypressed then begin k:=readkey; case k of #27:halt(1); #72:ey:=ey-1;#75:ex:=ex-1;#77:ex:=ex+1;#80:ey:=ey+1; 'l':l1:=not l1;'L':l2:=not l2; 'c':c1:=not c1;'C':c2:=not c2; 'p':p:=not p;'k':j:=not j; end;end; changepage; linl(100,150); gettime(h,m,sa,ms); until k=#27; closegraph; end. Aici acumulez programe şi algoritmi interesanti alcătuiţi de mine (cu mici excepţii) pe parcursul studierii unor limbaje de programare. Cea mai mare parte din ele sunt realizate în Pascal. Nu am scopul creării unui curs specializat sau a descrierii detaliate a anumitor limbaje, ci doar prezint informaţii utile, plus ceva exemple interesante...
Răsfoitorul de fișiere (File Browser):Codul sursă al programelor este organizat în mape şi fişiere. Paginile care conțin cod sursă de programe de regulă au un răsfoitor de fișiere în partea stangă a paginii reprezentat de un bloc cu titlul „File Browser”. Pentru a vizualiza un program sau conţinutul unei mape, faceţi click pe numele fişierului / mapei. Dacă fişierul nu este textual, el se va descărca automat, iar dacă este textual, conținutul lui se va afișa într-un bloc pe centrul paginii. Pentru a descărca un fişier, faceţi click pe dimensiunea (size) lui.
Căutare
|