aici am inceput ruleta ta. e rudimentara insa o dezvolti tu
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
Image1: TImage;
Memo1: TMemo;
Button2: TButton;
procedure FormShow(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormShow(Sender: TObject);
begin
Image1.Enabled:=true;
Image1.Visible:=true;
Image1.Canvas.Pixels[10,10]:=clWhite;
end;
procedure TForm1.Button2Click(Sender: TObject);
var p:double;
x,y,i,j,r:integer;
x1,y1,x2,y2:integer;
b:boolean;
sl:DOUBLE;
begin
p:=0;
r:=100;
x1:=0;y1:=0;
while p<=2*pi do
begin
x:=round(100*sin(p))+(Image1.Width div 2) ;
y:=round(100*cos(p))+(Image1.Height div 2);
with Image1.Canvas do
Pixels[x,y]:=clRed;
p:=p+1/r;
end;
b:=true;
i:=0;
randomize;
while j<1000 do
j:=random(2000);
Memo1.Lines.Add('j ' +inttostr(j));
sl:=3;
while b do
begin
p:=2*pi;
Memo1.Lines.Add(inttostr(i));
Application.ProcessMessages;
while p>0 do
begin
with Image1.Canvas do
begin
pen.Color:=clWhite;
moveto(Image1.Width div 2,Image1.Height div 2);
lineto(x1,y1);
Application.ProcessMessages;
end;
x:=round(100*sin(p))+(Image1.Width div 2) ;
y:=round(100*cos(p))+(Image1.Height div 2);
x1:=x;
y1:=y;
with Image1.Canvas do
begin
pen.Color:=clBlack;
moveto(Image1.Width div 2,Image1.Height div 2);
lineto(x,y);
inc(i);
Application.ProcessMessages;
end;
Sleep(round(sl));
Application.ProcessMessages;
if (i mod 50)=0 then
sl:=sl+0.5;
p:=p-1/r;
if i=j then
begin
b:=false;
Memo1.Lines.Add(inttostr(i));
break;
end;
end;
Application.ProcessMessages;
end;
end;
end.
cu chestia cu ruleta deschide un topic nou, ca asa e greu de urmarit
numa bine