Sunday, February 17, 2013

Shared Program (7)



Shared by Richard Duncan - works for iPad on Portrait:

10 EV=962
20 DIM M$(EV),P(60),W(60),C1(EV)
30 DIM ZV(EV),ODER(EV)
40 ANG=0
50 NN=960
60 SCREEN 1:CLS
70 N=0
80 D1=-18
90 D2=-10
100 D3=-26
110 D4=-90
120 D5=0
130 D6=0
140 D7=-20
150 D8=-52
160 D9=38
161 DA=-36
162 DB=-52
163 DC=170
170 P1=0
180 P2=-50
190 P3=-30-50
200 P4=-250+110
210 P5=150
220 P6=-80+20-18
230 P7=-100
240 P8=-50
250 P9=-280
251 PA=90
252 PB=200
253 PC=-320
260 FOR I=1 TO NN
270 ODER(I)=I
280 NEXT I
290 SR=64
300 R=320
310 J=0
320 T7=0
330 GOSUB 2710
340 ANG=ANG+1
350 M1 = P1
360 M2= P2
370 M3 = P3
380 XD= D1*3.14159 / 180
390 YD= D2*3.14159 / 180
400 ZD= D3*3.14159 / 180
410 S1=1
420 GOSUB 610
430 REM GOTO 1200
440 M1 = P4
450 M2= P5
460 M3 = P6
470 XD= D4*3.14159 / 180
480 YD= D5*3.14159 / 180
490 ZD= D6*3.14159 / 180
500 S1=2
510 GOSUB 610
520 M1= P7
530 M2= P8
540 M3 = P9
550 XD= D7*3.14159 / 180
560 YD= D8*3.14159 / 180
570 ZD= D9*3.14159 / 180
580 S1=3
590 GOSUB 610
591 M1= PA
592 M2= PB
593 M3 = PC
594 XD= DA*3.14159 / 180
595 YD= DB*3.14159 / 180
596 ZD= DC*3.14159 / 180
597 S1=4
598 GOSUB 610
600 GOTO 1200
610 J=0
620 FOR A = 0 TO 348 STEP 12
630 A2 = A + 12
640 A1 = A
650 A1 = A1 * 3.14159 / 180
660 A2 = A2 * 3.14159 / 180
670 J=J+1
680 FOR AA = 0 TO 315 STEP 45
690 T7=T7+1
700 A3 = AA
710 A4 = AA + 45
720 A3 = A3 * 3.14159 / 180
730 A4 = A4 * 3.14159 / 180
740 X = R * COS(A1) + COS(A1) * SR * COS(A3)+M1
750 Z= R * SIN(A1) + SIN(A1) * SR * COS(A3)+M3
760 Y = SR * SIN(A3)+M2
770 GOSUB 2290
780 X1 = X: Y1 = Y: Z1 = Z
790 X = R * COS(A1) + COS(A1) * SR * COS(A4)+M1
800 Z= R * SIN(A1) + SIN(A1) * SR * COS(A4)+M3
810 Y = SR * SIN(A4)+M2
820 GOSUB 2290
830 X2 = X: Y2 = Y: Z2 = Z
840 X = R * COS(A2) + COS(A2) * SR* COS(A4)+M1
850 Z= R * SIN(A2) + SIN(A2) * SR* COS(A4)+M3
860 Y = SR* SIN(A4)+M2
870 GOSUB 2290
880 X3 = X: Y3 = Y: Z3 = Z
890 X = R * COS(A2) + COS(A2) * SR* COS(A3)+M1
900 Z= R * SIN(A2) + SIN(A2) * SR* COS(A3)+M3
910 Y = SR* SIN(A3)+M2
920 GOSUB 2290
930 N=N+1
940 X4 = X: Y4 = Y: Z4 = Z
950 MX=X1:IF MX>X2 THEN MX=X2:IF MX>X3 THEN MX=X3
960 IF MX>X4 THEN MX=X4
970 MZ=Z1:IF MZ>Z2 THEN MZ=Z2:IF MZ>Z3 THEN MZ=Z3
980 IF MZ>Z4 THEN MZ=Z4
990 MY=Y1:IF MY>Y2 THEN MY=Y2:IF MY>Y3 THEN MY=Y3
1000 IF MY>Y4 THEN MY=Y4
1010 AX=X1:IF AX<X2 THEN AX=X2:IF AX<X3 THEN AX=X3
1020 IF AX<X4 THEN AX=X4
1030 AY=Y1:IF AY<Y2 THEN AY=Y2:IF AY<Y3 THEN AY=Y3
1040 IF AY<Y4 THEN AY=Y4
1050 IF T7=1 THEN SX=MX:IF T7=1 THEN SY=MY
1060 IF T7=1 THEN LX=AX:IF T7=1 THEN LY=AY
1070 IF T7>1 AND SX>MX THEN SX=MX
1080 IF T7>1 AND SY>MY THEN SY=MY
1090 IF T7>1 AND LX<AX THEN LX=AX
1100 IF T7>1 AND LY<AY THEN LY=AY
1110 ZV(N)=(Z1+Z2+Z3+Z4)*250
1120 REM ZV(N)=MZ*500
1130 J2=A
1140 J3=AA
1150 J1=S1
1160 GOSUB 3600
1170 NEXT AA
1180 NEXT A
1190 RETURN
1200 REM SX=SX-15
1210 REM SY=SY-15
1220 REM LX=LX+15
1230 REM LY=LY+15
1240 DV=ABS(LX-SX)
1250 BB=ABS(LY-SY)
1260 YT=900
1270 DX=700/DV
1280 DY=700/BB
1290 GOSUB 2950
1300 REM END
1310 FOR KK=1 TO NN
1320 V=ODER(KK)
1330 V1=VAL(MID$(M$(V),2,3))
1340 V2=VAL(MID$(M$(V),5,3))
1350 J1=VAL(MID$(M$(V),1,1))
1360 REM PRINT J1,V1,V2
1370 IF J1=1 THEN 1400
1380 IF J1=2 THEN 1460
1390 IF J1=3 THEN 1530
1391 IF J1=4 THEN 1582
1400 M1 = P1
1410 M2= P2
1420 M3 = P3
1430 XD= D1*3.14159 / 180
1440 YD= D2* 3.14159 / 180
1450 ZD= D3*3.14159 / 180:GOTO 1590
1460 M1 = P4
1470 M2= P5
1480 M3 = P6
1490 XD= D4*3.14159 / 180
1500 YD= D5* 3.14159 / 180
1510 ZD= D6* 3.14159 / 180
1520 GOTO 1590
1530 M1 = P7
1540 M2= P8
1550 M3 = P9
1560 XD= D7*3.14159 / 180
1570 YD= D8* 3.14159 / 180
1580 ZD= D9*3.14159 / 180
1581 GOTO 1590
1582 M1 = PA
1583 M2= PB
1584 M3 = PC
1585 XD= DA*3.14159 / 180
1586 YD= DB* 3.14159 / 180
1587 ZD= DC*3.14159 / 180
1590 J=V
1600 FOR A = V1 TO V1 +6 STEP 6
1610 A2 = A + 6
1620 A1 = A
1630 A1 = A1 * 3.14159 / 180
1640 A2 = A2 * 3.14159 / 180
1650 FOR AA = V2 TO V2+30 STEP 15
1660 A3 = AA
1670 A4=AA+15
1680 REM PRINT "aa=";AA
1690 REM PRINT "a3=";A3
1700 A3 = A3 * 3.14159 / 180
1710 A4 = A4 * 3.14159 / 180
1720 X = R * COS(A1) + COS(A1) * SR * COS(A3)+M1
1730 Z= R * SIN(A1) + SIN(A1) * SR * COS(A3)+M3
1740 Y = SR * SIN(A3)+M2
1750 REM PRINT "x=";X;A1;A3
1760 GOSUB 2290
1770 X1 = X
1780 Y1=Y
1790 Z1=Z
1800 X = R * COS(A1) + COS(A1) * SR * COS(A4)+M1
1810 Z= R * SIN(A1) + SIN(A1) * SR * COS(A4)+M3
1820 Y = SR * SIN(A4)+M2
1830 GOSUB 2290
1840 X2 = X
1850 Y2=Y
1860 Z2=Z
1870 X = R * COS(A2) + COS(A2) * SR * COS(A4)+M1
1880 Z= R * SIN(A2) + SIN(A2) * SR * COS(A4)+M3
1890 Y = SR* SIN(A4)+M2
1900 GOSUB 2290
1910 X3 = X
1920 Y3=Y
1930 Z3=Z
1940 X = R * COS(A2) + COS(A2) * SR* COS(A3)+M1
1950 Z= R * SIN(A2) + SIN(A2) * SR* COS(A3)+M3
1960 Y = SR* SIN(A3)+M2
1970 GOSUB 2290
1980 X4 = X
1990 Y4=Y
2000 Z4=Z
2010 DF=34
2020 X1=ABS(X1-SX)*DX+DF
2030 X2=ABS(X2-SX)*DX+DF
2040 X3=ABS(X3-SX)*DX+DF
2050 X4=ABS(X4-SX)*DX+DF
2060 Y1=YT-ABS(Y1-SY)*DY
2070 Y2=YT-ABS(Y2-SY)*DY
2080 Y3=YT-ABS(Y3-SY)*DY
2090 Y4=YT-ABS(Y4-SY)*DY
2100 REM PRINT X1;Y1;X2;Y2
2110 REM PRINT X3;Y3;X4;Y4
2120 TRIANGLE X1,Y1,X2,Y2,X3,Y3,C1(J),1
2130 TRIANGLE X1,Y1,X4,Y4,X3,Y3,C1(J),1
2140 LINE X1,Y1,X3,Y3,C1(J)
2150 LINE X1,Y1,X4,Y4,C1(J)
2160 LINE X1,Y1,X2,Y2,C1(J)
2170 LINE X2,Y2,X3,Y3,C1(J)
2180 LINE X3,Y3,X4,Y4,C1(J)
2190 REM LINE X1,Y1,X2,Y2,4
2200 REM LINE X2,Y2,X3,Y3,4
2210 REM LINE X3,Y3,X4,Y4,4
2220 REM LINE X1,Y1,X4,Y4,4
2230 NEXT AA
2240 NEXT A
2250 NEXT KK
2260 SLEEP 5000
2270 GOTO 60
2280 GOTO 2280
2290 XN = X * COS(YD)+ Z * SIN(YD)
2300 ZN = -X * SIN(YD) + Z * COS(YD)
2310 X = XN
2320 Z = ZN
2330 YN = -Z * SIN(XD) + Y * COS(XD)
2340 ZN = Z * COS(XD) + Y * SIN(XD)
2350 Y = YN
2360 Z = ZN
2370 XN = X * COS(ZD) + Y * SIN(ZD)
2380 YN = -X * SIN(ZD)+ Y * COS(ZD)
2390 X = XN
2400 Y = YN
2410 XR=-21+ANG
2420 YR=ANG
2430 ZR=-23+ANG
2440 REM XR=0:YR=0:ZR=0
2450 REM XR=XR*3.14159/180
2460 REM YR=YR*3.14159/180
2470 REM ZR=ZR*3.14159/180
2480 XN = X * COS(YR)+ Z * SIN(YR)
2490 ZN = -X * SIN(YR) + Z * COS(YR)
2500 X = XN
2510 Z = ZN
2520 YN = -Z * SIN(XR) + Y * COS(XR)
2530 ZN = Z * COS(XR)+ Y * SIN(XR)
2540 Y = YN
2550 Z = ZN
2560 XN = X * COS(ZR)+ Y * SIN(ZR)
2570 YN = -X * SIN(ZR)+ Y * COS(ZR)
2580 X = XN
2590 Y = YN
2600 RETURN
2610 CN=15
2620 FOR I=1 TO 200
2630 CN=CN+1:RED=RND(0)*255:GREEN=RND(0)*255:BLUE=RND(0)*255
2640 RED=INT(RED):GREEN=INT(GREEN):BLUE=INT(BLUE)
2650 CSET CN,RED,GREEN,BLUE,255
2660 RD(I)=RED:GR(I)=GREEN:BL(I)=BLUE
2670 REM PRINT CN,RED,GREEN,BLUE
2680 C1(I)=CN
2690 NEXT I
2700 RETURN
2710 U=0
2720 CSET 16,255,181,197,255
2730 T3=0
2740 FOR K=1 TO 4
2750 FOR I=1 TO 30
2760 T3=T3+1
2770 IF T3=1 THEN C2=0
2780 IF T3=2 THEN C2=1
2790 IF T3=2 THEN T3=0
2800 C3=C2
2810 FOR J=1 TO 8
2820 U=U+1
2830 C3=C3+1
2840 IF C3=1 AND K=1 THEN C1(U)=5
2850 IF C3=1 AND K=2 THEN C1(U)=2
2860 IF C3=2 AND K=1 THEN C1(U)=6
2870 IF C3=2 AND K=2 THEN C1(U)=3
2880 IF C3=1 AND K=3 THEN C1(U)=16
2890 IF C3=2 AND K=3 THEN C1(U)=1
2891 IF C3=1 AND K=4 THEN C1(U)=7
2892 IF C3=2 AND K=4 THEN C1(U)=8
2900 IF C3=2 THEN C3=0
2910 NEXT J
2920 NEXT I
2930 NEXT K
2940 RETURN
2950 N=NN
2960 K=1
2970 P(K) = 1
2980 W(K) = 1
2990 L = 1
3000 RR= N
3010 IF (RR- L) < 9 THEN 3030
3020 GOTO 3230
3030 IF (RR- L + 1) = 1 THEN 3050
3040 GOTO 3100
3050 L = P(K)
3060 RR= W(K)
3070 K = K - 1
3080 IF K = 0 THEN 3590
3090 GOTO 3010
3100 FOR I = L + 1 TO RR
3110 FOR J = L TO I - 1
3120 M = I - J + L - 1
3130 IF ZV(M) <= ZV(M + 1) THEN 3210
3140 T = ZV(M)
3150 ZV(M) = ZV(M + 1)
3160 T1 = ODER(M)
3170 ODER(M) = ODER(M + 1)
3180 ODER(M + 1) = T1
3190 ZV(M + 1) = T
3200 NEXT J
3210 NEXT I
3220 GOTO 3050
3230 I = L
3240 J = RR
3250 IF ZV(I) > ZV(J) THEN 3270
3260 GOTO 3440
3270 T = ZV(J)
3280 ZV(J) = ZV(I)
3290 T1 = ODER(J)
3300 ODER(J) = ODER(I)
3310 ODER(I) = T1
3320 ZV(I) = T
3330 I = I + 1
3340 IF J > I THEN 3360
3350 GOTO 3470
3360 IF ZV(J) < ZV(I) THEN 3380
3370 GOTO 3330
3380 T = ZV(J)
3390 ZV(J) = ZV(I)
3400 T1 = ODER(J)
3410 ODER(J) = ODER(I)
3420 ODER(I) = T1
3430 ZV(I) = T
3440 J = J - 1
3450 IF J > I THEN 3250
3460 GOTO 3470
3470 J = J + 1
3480 K=K+1
3490 IF (I - L) < (RR- J) THEN 3510
3500 GOTO 3550
3510 P(K) = J
3520 W(K) = RR
3530 RR= I
3540 GOTO 3010
3550 P(K) = L
3560 W(K) = I
3570 L=J
3580 GOTO 3010
3590 RETURN
3600 JA$ = STR$(J1)
3610 JB$ = MID$(JA$, 2, 1)
3620 JC$ = STR$(J2)
3630 JD$ = MID$(JC$, 2, LEN(JC$) - 1)
3640 JE$ = STR$(J3)
3650 JF$ = MID$(JE$, 2, LEN(JE$) - 1)
3660 IF J2 < 10 THEN JD$ = "00" + JD$
3670 IF J2 > 9 AND J2 < 100 THEN JD$ = "0" + JD$
3680 IF J2 > 100 THEN JD$ = JD$
3690 IF J3 < 10 THEN JF$ = "00" + JF$
3700 IF J3 > 9 AND J3 < 100 THEN JF$ = "0" + JF$
3710 IF J3 > 100 THEN JF$ = JF$
3720 NA$ = JB$ + JD$ + JF$
3730 M$(N)=NA$
3740 RETURN



No comments:

Post a Comment