procedure TForm1.Button1Click(Sender: TObject);
procedure line(x1,y1,x2,y2:integer);
begin
with canvas do begin
moveto(x1,y1);
lineto(x2,y2)
end
end;
var p, q, np, i, x, y, xo, yo : integer;
th, rs : real;
begin
write('p,qの値 ?');
readln(p,q);
np := 400 * q;
if (p mod 2 = 1) and
(q mod 2 = 1) then np := np div 2;
for i := 0 to np do begin
th := 2.0 * PI * i / 400;
rs := 180.0 * sin(p * th / q); {r=asin(pθ/q)}
x := round( rs * sin(th) + 320.0);
y := round(-rs * cos(th) + 200.0);
if i > 0 then line(xo,yo,x,y);
xo := x;
yo := y;
end;
end;
end.
2 :
デフォルトの名無しさん:2001/07/11(水) 18:50
エラーでるよ
3 :
デフォルトの名無しさん:2001/07/11(水) 18:53
こんそーるか
4 :
デフォルトの名無しさん:2001/07/11(水) 18:53
でちたよ!
上げ
6 :
デフォルトの名無しさん:2001/07/11(水) 19:23
1さん他になにか作ってください。
わたしにわつくれないー
1=2=3=4=5=6
ジサクジエンでした。
8 :
デフォルトの名無しさん:2001/07/11(水) 19:39
あきらかにちがうよ('-`)
2=3=4=6=8 なのさ
7行プログラムスレからはじき出された腹いせか?>1
そもそもアニメーションなのか?ものすごく目のいいやつには
アニメーションに見えるかもしれないが・・・。
11 :
1:2001/07/11(水) 23:14
age
それよりさあ、クリップボードに入ってるDelphiのソース
を取り出して半角空白2個を全角空白1個に置き換えて
再びクリップボードに戻すプログラム作ってよ。
13 :
1:2001/07/12(木) 02:53
procedure TForm1.OnFormPaint(Sender: TObject);
const
cx=150;
cy=150;
begin
with Form1.Canvas do
begin
Ellipse(cx-80,cy-80,cx+80,cy+80); {face}
Brush.Color:=clBlack;
Ellipse(cx-50,cy-40,cx-20,cy- 0); {left eye}
Ellipse(cx+20,cy-40,cx+50,cy- 0); {right eye}
Pen.Width:=2;
Arc(cx-60,cy-50,cx-10,cy+10, cx-10,cy-40,cx-60,cy-20); {left eyebrow}
Arc(cx+10,cy-50,cx+60,cy+10, cx+60,cy-20,cx+10,cy-40); {right eyebrow}
Pen.Width:=1;
Brush.Color:=clWhite;
TextOut(cx-13,cy-55,'Arc');
Brush.Color:=clFuchsia;
Ellipse(cx-30,cy-10,cx+30,cy+20); {nose}
Font.Color:=clWhite;
TextOut(cx-20,cy-5,'Ellipse');
Brush.Color:=clRed;
Chord(cx-60,cy-60,cx+60,cy+60, cx-60,cy+30,cx+60,cy+30); {mouth}
TextOut(cx-20,cy+30,'Chord');
Brush.Color:=clYellow;
Pie(cx-60,cy-220,cx+60,cy-60, cx-30,cy-75,cx+30,cy-75); {cap}
Font.Color:=clBlack;
TextOut(cx-10,cy-90,'Pie');
end;
end;
14 :
1:2001/07/12(木) 03:02
誰か簡単なアニメーションをDelphiでつくってください。
コード公開したいなら自分のページでやってリンクだけ示せ>1
とりあえず1の奴を本当にアニメーションするように改造したものを
恥を忍んでアプする。
procedure TForm1.Timer1Timer(Sender: TObject);
const
cx=150;
cy=150;
var
eyesize: Integer;
begin
eyesize := Ord(((GetTickCount div 50) mod 10)<7)*20+1;
with Form1.Canvas do
begin
Brush.Color:=clWhite;
Ellipse(cx-80,cy-80,cx+80,cy+80); {face}
Brush.Color:=clBlack;
Ellipse(cx-50,cy-20-eyesize,cx-20,cy-20+ eyesize); {left eye}
Ellipse(cx+20,cy-20-eyesize,cx+50,cy-20+ eyesize); {right eye}
Pen.Width:=2;
Arc(cx-60,cy-50,cx-10,cy+10, cx-10,cy-40,cx-60,cy-20); {left eyebrow}
Arc(cx+10,cy-50,cx+60,cy+10, cx+60,cy-20,cx+10,cy-40); {right eyebrow}
Pen.Width:=1;
Brush.Color:=clWhite;
TextOut(cx-13,cy-55,'Arc');
Brush.Color:=clFuchsia;
Ellipse(cx-30,cy-10,cx+30,cy+20); {nose}
Font.Color:=clWhite;
TextOut(cx-20,cy-5,'Ellipse');
Brush.Color:=clRed;
Chord(cx-60,cy-60,cx+60,cy+60, cx-60,cy+30,cx+60,cy+30); {mouth}
TextOut(cx-20,cy+30,'Chord');
Brush.Color:=clYellow;
Pie(cx-60,cy-220,cx+60,cy-60, cx-30,cy-75,cx+30,cy-75); {cap}
Font.Color:=clBlack;
TextOut(cx-10,cy-90,'Pie');
end;
end;
18 :
デフォルトの名無しさん:2001/07/12(木) 04:38
>>12 ClipBoard.AsText := StringReplace(ClipBoard.AsText, ' ', ' ', [rfReplaceAll]);
でできるだろ
>>18 thanks!タブコードと逆変換もついでに入れて使う事にするよ。