Home » Personal collection » Commodore disks » disk65a_programs_1.d64 » pascal's tri
pascal's tri
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
| Tape/disk: | Home » Personal collection » Commodore disks » disk65a_programs_1.d64 |
| Filename: | pascal's tri |
| Read OK: | ✔ |
| File size: | 038F bytes |
| Load address: | 0801 |
| Exec address: | 0000 |
Duplicates
There is 1 duplicate copy of this file in the archive:
- Personal collection » Commodore disks » disk50a2_progs1.d64 » pascal's tri
- Personal collection » Commodore disks » disk65a_programs_1.d64 » pascal's tri
File contents
40 S=16:B=3:C=8:SM=1024
45 POKE53272,(PEEK(53272) AND 15) OR S
50 POKE56578,PEEK(56578) OR 3
55 POKE56576,(PEEK(56576) AND 252) ORB
60 X=C*1024:H=INT(X/256):L=X-256*H
65 POKE51,L:POKE52,H
70 POKE55,L:POKE56,H
75 POKE53272,(PEEK(53272) AND 241) ORC
80 POKE53265,PEEK(53265) OR 32
85 FOR J=SM TO SM+999
90 POKEJ,1
95 NEXT
100 FOR J=X TO X+7999
105 POKE J,0
110 NEXT
111 GOTO2000
115 FOR L=0 TO 127
120 M=SQR(16129-L*L)
125 MAX=-1E9
130 FORN=-M TO M STEP 4
135 V=25*(SIN(0.001*(L*L+N*N)))
140 P=V+N/4+88
145 IF P<=MAX THEN 165
150 MAX=P
155 R=P:C=160-L:GOSUB1000
160 C=160+L:GOSUB1000
165 NEXT
170 NEXT
175 GETK$:IFK$<>" "THEN175
180 POKE53265,PEEK(53265) AND 223
185 POKE53272,(PEEK(53272) AND 240) OR4
190 STOP
1000 BYTE=X+7687-320*INT(R/8)-(RAND7)+INT(C/8)*8
1005 BIT=7-(CAND7)
1010 POKE BYTE,PEEK(BYTE) OR 2^BIT
1015 RETURN
2000 DIM X(1,300):P=0:X(0,150)=1:R=1
2010 GOSUB3000:P=ABS(SGN(P-1))
2020 FORM=1TO299:X(P,M)=X(ABS(SGN(P-1)),M-1)+X(ABS(SGN(P-1)),M+1):NEXT
2030 GOTO2010
3000 FORC=0TO300STEP2
3010 IFX(P,C)<>INT(X(P,C)/2)*2THENGOSUB1000:C=C+1:GOSUB1000:C=C-1
3020 NEXT:R=R+.5:IFR=190THEN4000
3030 RETURN
4000 GOTO4000
( S�16:B�3:C�8:SM�1024 9- �53272,(�(53272) � 15) � S Q2 �56578,�(56578) � 3 p7 �56576,(�(56576) � 252) �B �<