Jeśli chcesz wziąć udział w dyskusjach na forum - zaloguj się. Jeżeli nie masz loginu - poproś o członkostwo.
Vanilla 1.1.4 jest produktem Lussumo. Więcej informacji: Dokumentacja, Forum.
10 GOTO 100
20 FOR A=1 TO STAR:Z(A)=Z(A)-SPEED
30 IF Z(A)<=1 THEN X(A)=INT(ROZX*RND(0)-ROZX2):Y(A)=INT(ROZY*RND(0)-ROZY2):Z(A)=DEPTH
40 X=(X(A)*DEPTH)/Z(A)+ROZX2
50 IF X<0 OR X>ROZX THEN X(A)=INT(ROZX*RND(0)-ROZX2):Y(A)=INT(ROZY*RND(0)-ROZY2):Z(A)=DEPTH: GOTO 90
60 Y=(Y(A)*DEPTH)/Z(A)+ROZY2
70 IF Y<0 OR Y>ROZY THEN X(A)=INT(ROZX*RND(0)-ROZX2):Y(A)=INT(ROZY*RND(0)-ROZY2):Z(A)=DEPTH: GOTO 90
80 XEKR(A)=X:YEKR(A)=Y:COLOR 0:PLOT XOLD(A),YOLD(A):COLOR 1:PLOT XEKR(A),YEKR(A):XOLD(A)=X:YOLD(A)=Y
90 NEXT A:GOTO 20
100 STAR=50:SPEED=5:ROZX=159:ROZY=95:DEPTH=ROZX:ROZX2=ROZX/2:ROZY2=ROZY/2
120 DIM X(STAR),Y(STAR),Z(STAR),XEKR(STAR),YEKR(STAR),ISON(STAR),XOLD(STAR),YOLD(STAR)
130 FOR A=1 TO STAR:X(A)=INT(ROZX*RND(0)-ROZX2):Y(A)=INT(ROZY*RND(0)-ROZY2):Z(A)=INT(DEPTH*RND(0)):NEXT A
140 GRAPHICS 7+16: GOTO 20
10 GOTO 100
20 F.A=1TO STAR:Z(A)=Z(A)-SPEED:IF Z(A)<=1THEN X(A)=INT(ROZX*RND(0)-ROZX2):Y(A)=INT(ROZY*RND(0)-ROZY2):Z(A)=DEPTH
30 X=(X(A)*DEPTH)/Z(A)+ROZX2:IF X<0 OR X>ROZX THEN X(A)=INT(ROZX*RND(0)-ROZX2):Z(A)=DEPTH:NEXT A:GOTO 20
40 Y=(Y(A)*DEPTH)/Z(A)+ROZY2:IF Y<0 OR Y>ROZY THEN Y(A)=INT(ROZY*RND(0)-ROZY2):Z(A)=DEPTH:NEXT A:GOTO 20
50 XEKR(A)=X:YEKR(A)=Y:C.0:PLOT XOLD(A),YOLD(A):C.1:PLOT XEKR(A),YEKR(A):XOLD(A)=X:YOLD(A)=Y:NEXT A:GOTO 20
100 STAR=50:SPEED=5:ROZX=159:ROZY=95:DEPTH=ROZX:ROZX2=ROZX/2:ROZY2=ROZY/2
120 DIM X(STAR),Y(STAR),Z(STAR),XEKR(STAR),YEKR(STAR),ISON(STAR),XOLD(STAR),YOLD(STAR)
130 FOR A=1 TO STAR:X(A)=INT(ROZX*RND(0)-ROZX2):Y(A)=INT(ROZY*RND(0)-ROZY2):Z(A)=INT(DEPTH*RND(0)):NEXT A
140 GRAPHICS 7+16: GOTO 20
10 GOTO 100
20 FOR A=1 TO STAR
30 Z(A)=Z(A)-SPEED:IF Z(A)<=1 THEN 95
40 X=(X(A)*DEP)/Z(A)+RX2:IF X<0 OR X>RX THEN 95
60 Y=(Y(A)*DEP)/Z(A)+RY2:IF Y<0 OR Y>RY THEN 95
80 IF IO(A)=1 THEN COLOR 0:PLOT XE(A),YE(A)
81 XE(A)=X:YE(A)=Y:IO(A)=1:COLOR 1:PLOT X,Y
90 NEXT A:GOTO 20
95 IF IO(A)=1 THEN IO(A)=0:C.0:PL.XE(A),YE(A)
96 X(A)=RX*RND(0)-RX2:Y(A)=RY*RND(0)-RY2:Z(A)=DEP:NEXT A:GOTO 20
100 STAR=50:SPEED=5:RX=159:RY=95:DEP=RX:RX2=RX/2:RY2=RY/2
120 DIM X(STAR),Y(STAR),Z(STAR),XE(STAR),YE(STAR),IO(STAR)
130 F.A=1 TO STAR:X(A)=RX*RND(0)-RX2:Y(A)=RY*RND(0)-RY2:Z(A)=DEP*RND(0):IO(A)=0:N.A
140 GRAPHICS 7+16: GOTO 20
uses crt, fastgraph;
const star_max = 64;
star_speed = 2;
w = 160;
h = 96;
cx = w div 2;
cy = h div 2;
ds = 3;
var star_x, star_y, px, py: array [0..star_max-1] of byte;
star_s: array [0..star_max-1] of shortint;
x, y, i: byte;
procedure init;
begin
randomize;
x:=w shr 1;
y:=h shr 1;
for i:=0 to star_max-1 do begin
star_x[i]:=random(0);
star_y[i]:=random(0);
star_s[i]:=random(0);
end;
end;
procedure anim;
function test: Boolean;
begin
Result := ((px[i]<cx-ds) or (px[i]>cx+ds)) and ((py[i]<cy-ds) or (py[i]>cy+ds));
end;
begin
for i:=0 to star_max-1 do begin
if test then begin
SetColor(0);
PutPixel(px[i], py[i]);
end;
dec(star_s[i], star_speed);
if (star_s[i] < 0) then star_s[i]:=random(64);
px[i] := x+(star_x[i] div star_s[i]);
py[i] := y+(star_y[i] div star_s[i]);
if test then begin
SetColor(1);
PutPixel(px[i], py[i]);
end;
end;
end;
begin
InitGraph(7+16);
init;
repeat
pause;
anim;
until keypressed;
end.
10 GOTO 100
20 FOR A=1 TO STAR
30 ZA=Z(A)-SPEED:IF ZA<=1 THEN 95
40 X=XD(X(A)+RX2)/ZA+RX2:IF X<0 OR X>RX THEN 95
60 Y=YD(Y(A)+RY2)/ZA+RY2:IF Y<0 OR Y>RY THEN 95
80 IF IO(A)=1 THEN COLOR 0:PLOT XE(A),YE(A)
81 Z(A)=ZA:XE(A)=X:YE(A)=Y:IO(A)=1:COLOR 2: IF ZA>DEP2 THEN COLOR 1
82 PLOT X,Y
90 NEXT A:GOTO 20
95 IF IO(A)=1 THEN IO(A)=0:C.0:PL.XE(A),YE(A)
96 X(A)=RX*RND(0)-RX2:Y(A)=RY*RND(0)-RY2:Z(A)=DEP:GOTO 90
100 STAR=10:SPEED=5:RX=159:RY=95:DEP=RX:RX2=RX/2:RY2=RY/2:DEP2=DEP/2
120 DIM X(STAR),Y(STAR),Z(STAR),XE(STAR),YE(STAR),IO(STAR),XD(RX),YD(RY)
130 F.A=1 TO STAR:X(A)=RX*RND(0)-RX2:Y(A)=RY*RND(0)-RY2:Z(A)=DEP*RND(0):IO(A)=0:N.A
131 FOR A=1 TO RX: XD(A)=(A-RX2)*DEP: NEXT A
132 FOR A=1 TO RY: YD(A)=(A-RY2)*DEP: NEXT A
140 GRAPHICS 7+16: GOTO 20
STAR=10:SPEED=5:RX=159:RY=95:DEP=RX:RX2=RX/2:RY2=RY/2:DEP2=DEP/2
DIM X(STAR),Y(STAR),Z(STAR),XE(STAR),YE(STAR),IO(STAR),XD(RX),YD(RY)
F.A=1 TO STAR:X(A)=RAND(RX)-RX2:Y(A)=RAND(RY)-RY2:Z(A)=RAND(DEP):IO(A)=0:N.A
FOR A=1 TO RX: XD(A)=(A-RX2)*DEP: NEXT A
FOR A=1 TO RY: YD(A)=(A-RY2)*DEP: NEXT A
GRAPHICS 7+16
do
FOR A=1 TO STAR
ZA=Z(A)-SPEED
X=XD(X(A)+RX2)/ZA+RX2
Y=YD(Y(A)+RY2)/ZA+RY2
IF ZA<=1 OR X<0 OR X>RX or Y<0 OR Y>RY
IF IO(A)=1 THEN IO(A)=0:C.0:PL.XE(A),YE(A)
X(A)=RAND(RX)-RX2:Y(A)=RAND(RY)-RY2:Z(A)=DEP
else
IF IO(A)=1 THEN COLOR 0:PLOT XE(A),YE(A)
Z(A)=ZA:XE(A)=X:YE(A)=Y:IO(A)=1:COLOR 2
IF ZA>DEP2 THEN COLOR 1
PLOT X,Y
endif
NEXT A
loop
10 GOTO 100
20 FOR ST=O TO FST STEP STAR:FOR A=I TO STAR:COLOR O:PLOT XE(A),YE(A):COLOR CS(ST+A)
30 XE(A)=XS(ST+A):YE(A)=YS(ST+A):PLOT XE(A),YE(A):NEXT A:NEXT ST:GOTO 20
100 TRAP 10:? "NUMBER OF STARS (MAX 50)?":INPUT STAR:IF STAR<0 OR STAR>50 THEN STAR=50
110 I=1:O=0:SPEED=5:RX=159:RY=95:DEP=RX:RX2=RX/2:RY2=RY/2:DEP2=DEP/2:IZS=RX/SPEED:FST=STAR*(IZS-I)
120 DIM X(STAR),Y(STAR),Z(STAR),XE(STAR),YE(STAR),XD(RX),YD(RY),XS(IZS*STAR),YS(IZS*STAR),CS(IZS*STAR)
130 FOR A=I TO STAR:X(A)=RX*RND(O)-RX2:Y(A)=RY*RND(O)-RY2:Z(A)=DEP*RND(O):XE(A)=O:YE(A)=O:NEXT A
140 FOR A=I TO RX:XD(A)=(A-RX2)*DEP:NEXT A:FOR A=I TO RY:YD(A)=(A-RY2)*DEP:NEXT A
150 FOR ST=O TO FST STEP STAR:DS=ST/STAR*SPEED:FOR A=I TO STAR
160 ZA=Z(A)-DS:X=XD(X(A)+RX2)/ZA+RX2:Y=YD(Y(A)+RY2)/ZA+RY2
170 IF X<O OR X>RX OR Y<O OR Y>RY THEN X(A)=RX*RND(O)-RX2:Y(A)=RY*RND(O)-RY2:Z(A)=DEP:GOTO 160
180 C=2:IF ZA>DEP2 THEN C=I
190 CS(ST+A)=C:XS(ST+A)=X:YS(ST+A)=Y:NEXT A:? "STEP ";ST/STAR;" OF ";INT(IZS):NEXT ST
200 GRAPHICS 7+16:GOTO 20
10 GR.7:C.1:OX=30:OY=0
30 F.A=0 TO 63
40 OX=OX+OY
50 OY=OY-OX
60 PLOT 80+OX,48+OY
70 N.A
10 GR.7:C.1:OX=30:OY=0
30 F.A=0 TO 100
40 OX=OX+OY/16
50 OY=OY-OX/16
60 PLOT 80+OX,48+OY
70 N.A
10 GR.7:C.1:OX=30:OY=0
30 F.A=0 TO 403
40 OX=OX+OY/64
50 OY=OY-OX/64
60 PLOT 80+OX,48+OY
70 N.A
40 OX=OX+OY*.015625
50 OY=OY-OX*.015625
Od 1 do 34 z 34