Değerli abilerim kardeşlerim 9 taş tablosu cizip iki noktanın kesiştiği her noktaya bi daire ciziyorum toplamda 9 tane kesişen nokta var ve benim amacım 9 yerine 6 tane daire yerleştirme yani sorunum bazı daireler ust uste biniyor
Alıntı:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,extctrls, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
procedure TForm1.Button1Click(Sender: TObject);
var cubuk,pul:array [1..6] of tshape;
i,x,y:integer;
begin
randomize;
for i:=1 to 3 do
begin
cubuk[i]:=tshape.Create(self);
cubuk[i].Parent:=self;
cubuk[i].Left:=100;
cubuk[i].Top:=i*100;
cubuk[i].Width:=200;
cubuk[i].Height:=1;
cubuk[i].Brush.Color:=rgb(0,0,0);
cubuk[i+3]:=tshape.Create(self);
cubuk[i+3].Parent:=self;
cubuk[i+3].Left:=i*100;
cubuk[i+3].Top:=100;
cubuk[i+3].Width:=1;
cubuk[i+3].Height:=200;
cubuk[i+3].Brush.Color:=rgb(0,0,0);
end;
x:=100*(random(3]1);
y:=100*(random(3]1);
pul[1]:=tshape.Create(self);
pul[1].Parent:=self;
pul[1].Left:=x-5;
pul[1].Top:=y-5;
pul[1].Width:=10;
pul[1].Height:=10;
pul[1].Brush.Color:=rgb(255,0,0);
pul[1].Shape:=stCircle;
x:=100*(random(3]1);
y:=100*(random(3]1);
pul[1]:=tshape.Create(self);
pul[1].Parent:=self;
pul[1].Left:=x-5;
pul[1].Top:=y-5;
pul[1].Width:=10;
pul[1].Height:=10;
pul[1].Brush.Color:=rgb(255,0,0);
pul[1].Shape:=stCircle;
x:=100*(random(3]1);
y:=100*(random(3]1);
pul[1]:=tshape.Create(self);
pul[1].Parent:=self;
pul[1].Left:=x-5;
pul[1].Top:=y-5;
pul[1].Width:=10;
pul[1].Height:=10;
pul[1].Brush.Color:=rgb(255,0,0);
pul[1].Shape:=stCircle;
x:=100*(random(3]1);
y:=100*(random(3]1);
pul[2]:=tshape.Create(self);
pul[2].Parent:=self;
pul[2].Left:=x-5;
pul[2].Top:=y-5;
pul[2].Width:=10;
pul[2].Height:=10;
pul[2].Brush.Color:=rgb(0,0,255);
pul[2].Shape:=stCircle;
x:=100*(random(3]1);
y:=100*(random(3]1);
pul[2]:=tshape.Create(self);
pul[2].Parent:=self;
pul[2].Left:=x-5;
pul[2].Top:=y-5;
pul[2].Width:=10;
pul[2].Height:=10;
pul[2].Brush.Color:=rgb(0,0,255);
pul[2].Shape:=stCircle;
x:=100*(random(3]1);
y:=100*(random(3]1);
pul[2]:=tshape.Create(self);
pul[2].Parent:=self;
pul[2].Left:=x-5;
pul[2].Top:=y-5;
pul[2].Width:=10;
pul[2].Height:=10;
pul[2].Brush.Color:=rgb(0,0,255);
pul[2].Shape:=stCircle;
end;
end.
__________________
9 Taş ufak bi sorun
Programlama0 Mesaj
●29 Görüntüleme
- ReadBull.net
- Programlama ve Yazılım
- Programlama
- 9 Taş ufak bi sorun