Ciao a tutti...oggi a scuola abbiamo fatto poco...due ore di mate,una di italiano,una di storia e poi una di informatica...il prof di quest'ultima ci ha dato un programma che fa un uovo..eccolo qua...
program uovo;
uses crt,graph;const r=100;
h=1000;var x0,y0,i:integer; x,y:real; c:word;
begin
x0:=detect; initgraph(x0,y0,'c:\programmi\tp\bgi');
if graphresult<>grok then halt(1);
x0:=getmaxx div 2; y0:=getmaxy div 2-2*r; c:=getmaxcolor;
setfillstyle (slashfill,4);
setcolor(1); circle(x0,y0+r,r);
floodfill(x0,y0+r+1,1);
setcolor(6);
moveto(x0,y0);
for i:=0 to h do
begin
x:=pi*i/h; y:=4*r*sqr(sin(x));
lineto(round(x0+y*cos(x)), round(y0+y*sin(x)));
end;
setfillstyle(ltslashfill,6);
floodfill(x0,y0+r+1,6);l
ine(x0,y0,x0,y0+4*r);r
epeat until keypressed;
closegraph;
end.
martedì, dicembre 05, 2006
Iscriviti a:
Commenti sul post (Atom)
Nessun commento:
Posta un commento