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:

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�10249-�53272,(�(53272) � 15) � SQ2�56578,�(56578) � 3p7�56576,(�(56576) � 252) �B�<X�C�1024:H��(X�256):L�X�256�H�A�51,L:�52,H�F�55,L:�56,H�K�53272,(�(53272) � 241) �C�P�53265,�(53265) � 32�U� J�SM � SM�999	Z�J,1
	_� 	d� J�X � X�7999*	i� J,00	n�:	o�2000J	s� L�0 � 127]	xM��(16129�L�L)j	}MAX��1E9|	��N��M � M � 4�	�V�25�(�(0.001�(L�L�N�N)))�	�P�V�N�4�88�	�� P��MAX � 165�	�MAX�P�	�R�P:C�160�L:�1000�	�C�160�L:�1000�	���	��
��K$:�K$��" "�175)
��53265,�(53265) � 223H
��53272,(�(53272) � 240) �4N
��x
�BYTE�X�7687�320��(R�8)�(R�7)��(C�8)�8�
�BIT�7�(C�7)�
�� BYTE,�(BYTE) � 2�BIT�
���
�� X(1,300):P�0:X(0,150)�1:R�1�
��3000:P��(�(P�1))��M�1�299:X(P,M)�X(�(�(P�1)),M�1)�X(�(�(P�1)),M�1):�#��20102��C�0�300�2e��X(P,C)���(X(P,C)�2)�2��1000:C�C�1:�1000:C�C�1~��:R�R�.5:�R�190�4000������4000
ZH(@s.16:b.3:c.8:sm.1024@9H-@.53272,(.(53272) . 15) . s@qH2@.56578,.(56578) . 3@PH7@.56576,(.(56576) . 252) .b@.H<@x.c.1024:h..(x.256):l.x.256.h@.Ha@.51,l:.52,h@.Hf@.55,l:.56,h@.Hk@.53272,(.(53272) . 241) .c@.Hp@.53265,.(53265) . 32@.Hu@. j.sm . sm.999@GIz@.j,1@MI.@.@ ID@. j.x . x.7999@*II@. j,0@0IN@.@:IO@.2000@jIS@. l.0 . 127@]IX@m..(16129.l.l)@JI.@max..1e9@.I.@.n..m . m . 4@.I.@v.25.(.(0.001.(l.l.n.n)))@.I.@p.v.n.4.88@.I.@. p..max . 165@.I.@max.p@.I.@r.p:c.160.l:.1000@.I.@c.160.l:.1000@.I.@.@.I.@.@OJ.@.k$:.k$.." ".175@)J.@.53265,.(53265) . 223@hJ.@.53272,(.(53272) . 240) .4@nJ.@.@XJ.Cbyte.x.7687.320..(r.8).(r.7)..(c.8).8@.J.Cbit.7.(c.7)@.J.C. byte,.(byte) . 2.bit@.J.C.@.J.G. x(1,300):p.0:x(0,150).1:r.1@.J.G.3000:p..(.(p.1))@YK.G.m.1.299:x(p,m).x(.(.(p.1)),m.1).x(.(.(p.1)),m.1):.@#K.G.2010@2K.K.c.0.300.2@EK.K.x(p,c)...(x(p,c).2).2..1000:c.c.1:.1000:c.c.1@.K.K.:r.r..5:.r.190.4000@.K.K.@.K.O.4000@@@
00000000  1a 08 28 00 53 b2 31 36  3a 42 b2 33 3a 43 b2 38  |..(.S.16:B.3:C.8|
00000010  3a 53 4d b2 31 30 32 34  00 39 08 2d 00 97 35 33  |:SM.1024.9.-..53|
00000020  32 37 32 2c 28 c2 28 35  33 32 37 32 29 20 af 20  |272,(.(53272) . |
00000030  31 35 29 20 b0 20 53 00  51 08 32 00 97 35 36 35  |15) . S.Q.2..565|
00000040  37 38 2c c2 28 35 36 35  37 38 29 20 b0 20 33 00  |78,.(56578) . 3.|
00000050  70 08 37 00 97 35 36 35  37 36 2c 28 c2 28 35 36  |p.7..56576,(.(56|
00000060  35 37 36 29 20 af 20 32  35 32 29 20 b0 42 00 92  |576) . 252) .B..|
00000070  08 3c 00 58 b2 43 ac 31  30 32 34 3a 48 b2 b5 28  |.<.X.C.1024:H..(|
00000080  58 ad 32 35 36 29 3a 4c  b2 58 ab 32 35 36 ac 48  |X.256):L.X.256.H|
00000090  00 a2 08 41 00 97 35 31  2c 4c 3a 97 35 32 2c 48  |...A..51,L:.52,H|
000000a0  00 b2 08 46 00 97 35 35  2c 4c 3a 97 35 36 2c 48  |...F..55,L:.56,H|
000000b0  00 d1 08 4b 00 97 35 33  32 37 32 2c 28 c2 28 35  |...K..53272,(.(5|
000000c0  33 32 37 32 29 20 af 20  32 34 31 29 20 b0 43 00  |3272) . 241) .C.|
000000d0  ea 08 50 00 97 35 33 32  36 35 2c c2 28 35 33 32  |..P..53265,.(532|
000000e0  36 35 29 20 b0 20 33 32  00 fe 08 55 00 81 20 4a  |65) . 32...U.. J|
000000f0  b2 53 4d 20 a4 20 53 4d  aa 39 39 39 00 07 09 5a  |.SM . SM.999...Z|
00000100  00 97 4a 2c 31 00 0d 09  5f 00 82 00 20 09 64 00  |..J,1..._... .d.|
00000110  81 20 4a b2 58 20 a4 20  58 aa 37 39 39 39 00 2a  |. J.X . X.7999.*|
00000120  09 69 00 97 20 4a 2c 30  00 30 09 6e 00 82 00 3a  |.i.. J,0.0.n...:|
00000130  09 6f 00 89 32 30 30 30  00 4a 09 73 00 81 20 4c  |.o..2000.J.s.. L|
00000140  b2 30 20 a4 20 31 32 37  00 5d 09 78 00 4d b2 ba  |.0 . 127.].x.M..|
00000150  28 31 36 31 32 39 ab 4c  ac 4c 29 00 6a 09 7d 00  |(16129.L.L).j.}.|
00000160  4d 41 58 b2 ab 31 45 39  00 7c 09 82 00 81 4e b2  |MAX..1E9.|....N.|
00000170  ab 4d 20 a4 20 4d 20 a9  20 34 00 9a 09 87 00 56  |.M . M . 4.....V|
00000180  b2 32 35 ac 28 bf 28 30  2e 30 30 31 ac 28 4c ac  |.25.(.(0.001.(L.|
00000190  4c aa 4e ac 4e 29 29 29  00 a9 09 8c 00 50 b2 56  |L.N.N))).....P.V|
000001a0  aa 4e ad 34 aa 38 38 00  bc 09 91 00 8b 20 50 b3  |.N.4.88...... P.|
000001b0  b2 4d 41 58 20 a7 20 31  36 35 00 c6 09 96 00 4d  |.MAX . 165.....M|
000001c0  41 58 b2 50 00 dc 09 9b  00 52 b2 50 3a 43 b2 31  |AX.P.....R.P:C.1|
000001d0  36 30 ab 4c 3a 8d 31 30  30 30 00 ee 09 a0 00 43  |60.L:.1000.....C|
000001e0  b2 31 36 30 aa 4c 3a 8d  31 30 30 30 00 f4 09 a5  |.160.L:.1000....|
000001f0  00 82 00 fa 09 aa 00 82  00 0f 0a af 00 a1 4b 24  |..............K$|
00000200  3a 8b 4b 24 b3 b1 22 20  22 a7 31 37 35 00 29 0a  |:.K$.." ".175.).|
00000210  b4 00 97 35 33 32 36 35  2c c2 28 35 33 32 36 35  |...53265,.(53265|
00000220  29 20 af 20 32 32 33 00  48 0a b9 00 97 35 33 32  |) . 223.H....532|
00000230  37 32 2c 28 c2 28 35 33  32 37 32 29 20 af 20 32  |72,(.(53272) . 2|
00000240  34 30 29 20 b0 34 00 4e  0a be 00 90 00 78 0a e8  |40) .4.N.....x..|
00000250  03 42 59 54 45 b2 58 aa  37 36 38 37 ab 33 32 30  |.BYTE.X.7687.320|
00000260  ac b5 28 52 ad 38 29 ab  28 52 af 37 29 aa b5 28  |..(R.8).(R.7)..(|
00000270  43 ad 38 29 ac 38 00 88  0a ed 03 42 49 54 b2 37  |C.8).8.....BIT.7|
00000280  ab 28 43 af 37 29 00 a3  0a f2 03 97 20 42 59 54  |.(C.7)...... BYT|
00000290  45 2c c2 28 42 59 54 45  29 20 b0 20 32 ae 42 49  |E,.(BYTE) . 2.BI|
000002a0  54 00 a9 0a f7 03 8e 00  cb 0a d0 07 86 20 58 28  |T............ X(|
000002b0  31 2c 33 30 30 29 3a 50  b2 30 3a 58 28 30 2c 31  |1,300):P.0:X(0,1|
000002c0  35 30 29 b2 31 3a 52 b2  31 00 e1 0a da 07 8d 33  |50).1:R.1......3|
000002d0  30 30 30 3a 50 b2 b6 28  b4 28 50 ab 31 29 29 00  |000:P..(.(P.1)).|
000002e0  19 0b e4 07 81 4d b2 31  a4 32 39 39 3a 58 28 50  |.....M.1.299:X(P|
000002f0  2c 4d 29 b2 58 28 b6 28  b4 28 50 ab 31 29 29 2c  |,M).X(.(.(P.1)),|
00000300  4d ab 31 29 aa 58 28 b6  28 b4 28 50 ab 31 29 29  |M.1).X(.(.(P.1))|
00000310  2c 4d aa 31 29 3a 82 00  23 0b ee 07 89 32 30 31  |,M.1):..#....201|
00000320  30 00 32 0b b8 0b 81 43  b2 30 a4 33 30 30 a9 32  |0.2....C.0.300.2|
00000330  00 65 0b c2 0b 8b 58 28  50 2c 43 29 b3 b1 b5 28  |.e....X(P,C)...(|
00000340  58 28 50 2c 43 29 ad 32  29 ac 32 a7 8d 31 30 30  |X(P,C).2).2..100|
00000350  30 3a 43 b2 43 aa 31 3a  8d 31 30 30 30 3a 43 b2  |0:C.C.1:.1000:C.|
00000360  43 ab 31 00 7e 0b cc 0b  82 3a 52 b2 52 aa 2e 35  |C.1.~....:R.R..5|
00000370  3a 8b 52 b2 31 39 30 a7  34 30 30 30 00 84 0b d6  |:.R.190.4000....|
00000380  0b 8e 00 8e 0b a0 0f 89  34 30 30 30 00 00 00     |........4000...|
0000038f