28 janvier

RESSOURCES

Mes programmes en basic et mes routines en langage machine

Faites un copier – coller du listing qui vous interesse. Sauvegardez la copie comme fichier texte (nomfichier.txt). Convertissez ce fichier en fichier tape (nomfichier.tap) à l’aide du programme Bas2Tap.exe fourni avec OSDK de defense-force. Le fichier txt doit être placé de préférence dans le même sous-répertoire (OSDK\BIN). Sur la ligne de commande du DOS tapez : Bas2Tap -b2t0 nomfichier.txt nomfichier.tap. Transferez le ficier .tap dans le sous-répertoire Tapes du Euphoric, qui doit être configuré par setup. Cliquez avec le bouton droit sur ce fichier et choisissez ATMOS ou ORIC 1 en fonction du listing. Attention, les routines créées pour l’un ne tournéront pas sur l’autre ! Aprez l’affichage de l’Euphoric, à l’invite READY éxécutez le programme. A la fin, dans le cas de la mise en place d’une routine en langage machine par un programme en basic, faitez : CSAVE « nomroutineBIN.tap »,A adresse début,E adresse fin. Ces adresses sont indiquées au debut du programme, par exemple #7000 et #745B. Attention, les programmes utilisant les routines ne peuvent pas être chargés et lancés avant le chargement des routines BIN.tap. Pour voir le résultat des démonstrations consultez l’album photos.

ROUTINE « Trames et collages » » publiée dans THEORIC N° 23, page 28

10 A=#7000:F=#745B:L=100
15 REPEAT
16 B=A:FORA=B TO B+15
17 READ C$
20 K=VAL(« # »+C$):S=S+K+65536*(S+K>65535):IF A<=F THEN POKE A,K
30 NEXT A
35 READ D$:IF S=VAL(« # »+D$) THEN L=L+5:UNTIL A>F:END
40 PING:PRINT »Erreur ligne »;L
100 DATA 50,41,54,43,48,57,4F,52,4B,53,20,52,31,20,44,2E,043B
105 DATA 20,56,61,73,69,6C,6A,65,76,69,63,20,31,37,20,6D,0980
110 DATA 61,72,73,20,31,39,38,36,20,0A,D8,E0,04,90,11,A9,0EEE
115 DATA F9,A0,CD,20,ED,CB,20,F8,C5,38,E9,30,AA,18,90,EB,1897
120 DATA 8E,E9,6F,20,41,F1,AD,E1,02,49,FF,8D,E0,6F,AE,19,214A
125 DATA 02,8E,E1,6F,8E,E3,6F,AC,1A,02,8C,E2,6F,8C,E4,6F,298E
130 DATA AD,F0,6F,C9,0A,90,1F,A9,0A,8D,F0,6F,A9,95,8D,F2,3278
135 DATA 6F,A9,96,8D,F4,6F,A9,97,8D,F6,6F,A9,00,8D,F1,6F,3BDE
140 DATA 8D,F3,6F,8D,F5,6F,A9,00,8D,E5,6F,8D,E8,6F,A0,09,44D5
145 DATA 99,DF,02,88,D0,FA,AE,E3,6F,8E,E1,02,AC,E4,6F,8C,4E9D
150 DATA E3,02,20,41,F1,AD,E1,02,CD,E0,6F,F0,1C,CE,E3,6F,57AC
155 DATA AE,E3,6F,E0,0B,F0,12,A9,00,18,90,D2,68,68,4C,E8,5FC0
160 DATA 71,AD,08,02,C9,B4,F0,F4,60,EE,E3,6F,A9,00,8D,E7,6906
165 DATA 6F,8D,E6,6F,AC,E8,6F,AD,E3,6F,99,00,77,AD,E4,6F,7269
170 DATA 99,00,78,20,C1,70,A9,00,A0,09,99,DF,02,88,D0,FA,79E9
175 DATA AE,E3,6F,8E,E1,02,AC,E4,6F,8C,E3,02,A9,02,8D,E5,82E7
180 DATA 02,20,2D,F0,AC,E4,6F,C0,00,F0,3E,AE,E3,6F,8E,E1,8B82
185 DATA 02,AC,E4,6F,88,8C,E3,02,20,05,72,AE,E1,02,EC,E0,9370
190 DATA 6F,F0,21,A9,01,CD,E7,6F,F0,1F,8D,E7,6F,AC,E5,6F,9CAF
195 DATA AD,E3,6F,99,00,75,AE,E4,6F,CA,8A,99,00,76,EE,E5,A5F3
200 DATA 6F,18,90,05,A9,00,8D,E7,6F,AC,E4,6F,C0,C7,F0,3B,AE4C
205 DATA C8,8C,E3,02,AE,E3,6F,8E,E1,02,20,05,72,AD,E1,02,B61D
210 DATA CD,E0,6F,F0,21,A9,01,CD,E6,6F,F0,1F,8D,E6,6F,AC,BFB3
215 DATA E5,6F,AD,E3,6F,99,00,75,AE,E4,6F,E8,8A,99,00,76,C896
220 DATA EE,E5,6F,18,90,05,A9,00,8D,E6,6F,EE,E3,6F,AE,E3,D1E1
225 DATA 6F,E0,F0,F0,17,8E,E1,02,AC,E4,6F,8C,E3,02,20,05,DA2D
230 DATA 72,AE,E1,02,EC,E0,6F,F0,03,4C,E3,70,AC,E8,6F,CE,E3CE
235 DATA E3,6F,AD,E3,6F,99,00,79,EE,E8,6F,AD,E5,6F,C9,00,ED40
240 DATA F0,2A,CE,E5,6F,AC,E5,6F,B9,00,75,8D,E3,6F,8D,E1,F6F7
245 DATA 02,B9,00,76,8D,E4,6F,8D,E3,02,20,05,72,AE,E1,02,FDA2
250 DATA EC,E0,6F,F0,C7,4C,8E,70,20,9B,FA,60,AC,E8,6F,A9,079F
255 DATA FF,99,00,77,20,7B,73,AD,E9,6F,C9,00,F0,EA,C9,03,1030
260 DATA 90,0F,18,90,09,A9,00,8D,E2,02,20,41,F1,60,4C,CC,1664
265 DATA 72,C9,01,F0,0C,A2,02,8E,97,72,E8,8E,9F,72,18,90,1E06
270 DATA 09,A2,03,8E,97,72,CA,8E,9F,72,AD,EA,6F,18,6D,EB,262A
275 DATA 6F,8D,EE,6F,AD,EC,6F,18,6D,ED,6F,8D,EF,6F,20,44,2EBB
280 DATA 72,18,90,10,A0,09,A9,00,99,DF,02,88,D0,FA,A0,00,35A3
285 DATA 8C,E9,6F,60,20,C1,70,B9,00,77,C9,FF,F0,8A,8D,E1,3F18
290 DATA 6F,AA,B9,00,78,8D,E2,6F,8A,CD,EF,6F,F0,09,90,07,4785
295 DATA 38,ED,EF,6F,18,90,F2,CD,EC,6F,F0,22,90,20,AD,E2,511B
300 DATA 6F,CD,EE,6F,F0,09,90,07,38,ED,EE,6F,18,90,F2,CD,5A2D
305 DATA EA,6F,F0,0A,90,08,A9,03,8D,E5,02,18,90,05,A9,02,6090
310 DATA 8D,E5,02,AD,E1,6F,8D,E1,02,AD,E2,6F,8D,E3,02,20,6901
315 DATA 2D,F0,AE,E9,6F,AC,E9,6F,FE,00,77,BD,00,77,DD,00,71AE
320 DATA 79,90,91,EE,E9,6F,C8,D0,8B,4C,E8,71,A9,20,8D,E0,7B8C
325 DATA 6F,4A,8D,E1,6F,4A,8D,E2,6F,4A,8D,E3,6F,4A,8D,E4,842E
330 DATA 6F,4A,8D,E5,6F,A9,00,8D,E9,6F,A9,00,8D,E6,6F,A9,8C8A
335 DATA 50,8D,E7,6F,20,44,72,20,C1,70,AC,E9,6F,B9,00,77,9418
340 DATA C9,FF,F0,C5,8D,E1,02,AA,B9,00,78,A8,8D,E3,02,A9,9DA3
345 DATA 03,8D,E5,02,C0,00,F0,1A,AD,E6,6F,85,00,AD,E7,6F,A56E
350 DATA 85,01,A5,00,18,69,28,85,00,A5,01,69,00,85,01,88,A9E4
355 DATA D0,F0,8A,C9,00,F0,0B,38,E9,06,C9,06,90,04,C8,18,B15C
360 DATA 90,F1,8D,E8,6F,98,18,65,00,85,00,A5,01,69,00,85,B7EF
365 DATA 01,A0,00,B1,00,AE,E8,6F,3D,E0,6F,F0,01,C8,8C,E5,BFFC
370 DATA 02,20,2D,F0,AE,E9,6F,AC,E9,6F,FE,00,77,BD,00,77,C7EE
375 DATA DD,00,79,90,03,EE,E9,6F,4C,F7,72,AD,F1,6F,85,02,D066
380 DATA AD,F2,6F,85,03,AD,F3,6F,85,04,AD,F4,6F,85,05,AD,D8DB
385 DATA F5,6F,85,06,AD,F6,6F,85,07,A0,00,B9,00,77,38,E9,E059
390 DATA 01,91,02,B9,00,78,91,04,B9,00,79,18,69,01,91,06,E4FE
395 DATA C8,D0,E8,AD,F2,6F,38,E9,03,8D,F2,6F,AD,F4,6F,38,EEE6
400 DATA E9,03,8D,F4,6F,AD,F6,6F,38,E9,03,8D,F6,6F,CE,F0,F8A8
405 DATA 6F,D0,08,20,85,FA,A9,0A,8D,F0,6F,60,20,0A,D8,E0,006F
410 DATA 0A,90,11,A9,F9,A0,CD,20,ED,CB,20,F8,C5,38,E9,30,092F
415 DATA AA,18,90,EB,E8,A9,FD,18,69,03,CA,D0,FA,8D,E9,6F, 12F7
420 DATA A9,95,38,ED,E9,6F,85,03,A9,96,38,ED,E9,6F,85,05,1B80
425 DATA A9,97,38,ED,E9,6F,85,07,A9,00,85,02,85,04,85,06,220D
430 DATA 20,C1,70,A0,00,8C,E8,6F,A9,00,8D,E5,02,B1,02,C9,297A
435 DATA FE,F0,24,8D,E1,02,B1,04,8D,E3,02,20,2D,F0,AC,E8,31F4
440 DATA 6F,B1,06,8D,E1,02,B1,04,8D,E3,02,20,2D,F0,EE,E8,39C4
445 DATA 6F,AC,E8,6F,18,90,D6,4C,E8,71,6C,55,00,00,00,00,401A

CAMEMBERT

100 HIMEM#6EEE’TRAMES-DEMONSTRATION
110 HIRES: A=0 ‘INEVITABLE CAMEMBERT
120 CURSET119,99,3:CIRCLE80,1
130 :FORI=1TO8
140 : CURSET119,99,1
150 : A=A+PI/20*I
160 : DRAW79*COS(A),79*SIN(A),1
170 : NEXTI:N=0
180 : FORI=1TO8
190 : N=N+PI/20*I+PI/40
200 : CURSET119+50*COS(N),99+50*SIN(N),3
210 : READ A,B,C,D
220 : POKE#6FEA,A
230 : POKE#6FEB,B
240 : POKE#6FEC,C
250 : POKE#6FED,D
260 : READ X
270 : CALL#7028,X
280 :NEXTI
290 DATA 2,2,2,2,2
300 DATA 0,0,0,0,0
310 DATA 1,1,1,1,1
320 DATA 0,2,2,2,2
330 DATA 1,4,1,6,2
340 DATA 4,4,4,4,1
350 DATA 2,2,0,2,2
360 DATA 2.4,1,5,1
370 DATA 2,4,1,5,2
380 DIMA$(40)
390 A$= »CAMEMBERUS VULGARIS »
400 CURSET50,5,3
410 :FORI=1TOLEN(A$)
420 : A=ASC(MID$(A$,I,1))
430 : CHARA,0,1:CURMOV7,0,3
440 :NEXTI
450 END BRAQUE

100 HIMEM#4FFF:HIRES:DIMX(5),Y(5),R(5)
110 POKE#6FF0,11’Compteur contours a 0.
120 :FORI=1TO5 ‘BRAQUE aleatoire ; Le remplissage
130 : X=RND(I)*199:’Y=RND(I)*149′ du fond doit
140 : IFX<50THENX=50′ etre arrete
150 : IFX>190THENX=190′ juste avant
160 : IFY<50THENY=50′ la fin!
170 : IFY>150THENY=150’ _ (fleche curseur’\/)
180 : X(I)=INT(X):Y(I)=INT(Y):CURSETX(I),Y(I),3
190 : R=RND(1)*(180-X):R1=R/(180-X)*(140-Y)
200 : IFR1<RTHEN R=R1 –
210 : R(I)=INT(R)-30*(R<30)
220 : IFY+R(I)>199ORY-R(I)<0THEN190
230 : IFX+R(I)>239ORX-R(I)<0THEN190
240 : CIRCLER(I),1:CURSETX(I),Y(I),1
250 : A=RND(1)*(180-X):B=RND(1*(140-Y)
260 : A=INT(A)-30*(A<30):B=INT(B)-30*(B<30)
270 : IFX+2*A>239ORY+2*B>199THEN250
260 : IFX-A<0ORY-B<0THEN250
290 : DRAWA,B,1:DRAWA,-B,1:DRAW-A,-B,1:DRAW-A,B,1
300 :NEXTI
310 :FORI=1TO5
320 : P=POINT(X(I)-1,Y(I)-1)
330 : IFP<>0THENX(I)=X(I)-1:Y(I)=Y(I)-1:GOT0320
340 : READ A,B,C,D,OP
350 : POKE#6FEA,A:POKE#6FEB,B:POKE#6FEC,C:POKE#6FED,D
360 : CURSETX(I)-1,Y(I)-1,3
370 : CALL#7028,OP
380 : OP=(OP=2)-(OP=1)+OP:IF OP=0THENOP=3
390 : P=POINT(X(I)+R(I)/2,Y(I)+R(I)/4)
400 : IFP<>0THENX(I)=X(I)+1:Y(I)=Y(I)+1:GOTO390
410 : CURSETX(I)+R(I)/2,Y(I)+R(I)/4,3:CALL#7028,OP
420 :NEXTI:CURSET0,0,3:CALL#7028,0
430 FOR I=0T09:CALL#73DC,I:NEXTI:END
440 DATA 1,6,1,6,2,4,4,4,4,1,0,0,0,0,0,1,4,0,5,2,0,5,1,4,2

CLASSEMENT INSTANTANE publié dans THEORIVC N° 20, page 44

100 REM LISTING No 1 – ORIC 1 et ATMOS
101 CALL#EE1A
110 DIMA(100):FORI=0TO100:A=INT(RND(1)*100):PRINTA;:A(A)=A(A)+1:NEXT:PRINT:PRINT
120 REMARQUE: Les nombres sont classes, Impression:
140 FORI=0TO100:IFA(I)=0THEN160
150 FORJ=1TOA(I):PRINTI; :NEXTJ
160 NEXTI:PRINT:PRINT:CALL#EDE0:END
200 REM LISTING No 2
201 CALL#EE1A: DIMN$(100,100): PRINT »TYPE NOMBRE »:PRINT
210 DIMA(100):FORI=0TO100:A=INT(RND(1)*100):A(A)=A(A)+1:PRINTI,A
215 N$(A,A(A))=STR$(I):NEXT:PRINT:PRINT
220 REMARQUE: Les nombres sont classes, Impression:
225 PRINT »NOMBRE TYPE »:PRINT
240 FORI=0TO100:IFA(I)=0THEN260
250 FORJ=1TOA(I):PRINTI,N$(I,J):NEXTJ
260 NEXTI:PRINT:PRINT:CALL#EDE0:END
300 REM LISTING No 3
301 CALL#EE1A:PRINT »PATIENTEZ »:FORI=#2000TO2*4000:POKEI,0:NEXT
310 FORI=0TO4000:A=INT(RND(1)*4000):DOKE(#2000+2*A),DEEK(#2000+2*A)+1:NEXT
320 REMARQUE: Les nombress sont classes. Impression:
340 FORI=0TO4000:IFDEEK(#2000+2*I)=0THEN360
350 FORJ=1TODEEK(#2000+2*I):PRINTI;:NEXTJ
360 NEXTI:PRINT:PRINT:CALL#EDE0:END
400 REM LISTING No 4
401 CALL#EE1A
410 DIMA(1000):FORI=0TO99:A=(RND(1)*10):PRINTA; :A=INT(-A*100)*(-1)
415 A(A)=A(A)+1:NEXT:PRINT:PRINT
420 REMARQUE: Les nombress sont classes. Impression:
440 FORI=0TO999:IFA(I)=0THEN460
450 FORJ=1TOA(I):PRINTI/100; :NEXTJ
460 NEXTI:PRINT:PRINT:CALL#EDE0:END
500 REM LISTING No 5
501 CALL#EE1A:S=1
510 DIMA(1000):FORI=0TO49:A=(RND(1)*5)*S:PRINTA;:A=INT(-A*100)*(-1):S=-S
515 A(A+500)=A(A+500)+1:NEXT:PRINT:PRINT
520 REMARQUE: Les nombress sont classes. Impression:
540 FORI=0TO999:IFA(I)=0THEN560
550 FORJ=1TOA(I):PRINT(I-500)/100;:NEXTJ
560 NEXTI:PRINT:PRINT:CALL#EDE0:END
600 REM LISTING No 6
601 CALL#EE1A:HIRES:PRINT »TYPE NOMBRE » : PRINT
610 FORX=0TO239:Y=INT(RND(1)*199):CURSETX,Y,1:PRINTX,Y:NEXT:PRINT:PRINT
620 REMARQUE: Les nombress sont classes. Impression:
625 PRINT »NOMBRE TYPE »: PRINT
640 FOR Y=0TO199:FORX=0TO239:CURSETX,Y,3:IFPOINT(X,Y)=0THEN660
650 PRINTX
660 NEXTX,Y:PRINT:PRINT:CALL#EDE0:END
700 REM LISTING No ‘7
701 CALL#EE1A:HIRES:PRINT »NOMBRE »:PRINT
710 FORI=0TO48000:A=RND(1)*48000:R=INT(A):PRINTA
715 Y=INT(A/240):X=240*(A/240-Y):IFX-INT(X)>.999THENX=X+l
716 CURSETX,Y,1:NEXT
720 REMARQUE:Les nombress sont classes. Impression:
625 PRINT »NOMBRE »:PRINT
640 FORY=0TO199:FORX=0T0239:CURSETX,Y,3:IFPOINT(X,Y)=0THEN7660
650 PRINT240*Y+X
760 NEXTX,Y:PRINT:PRINT:CALL#EDE0:END
800 REM LISTING No 8 (HISTOGRAMME)
801 CALL#EE1A:PARER0:INK7:HIRES
810 FORX=0TO239:Y=INT(RND(1)*199):CURSETX,199-Y,1
811 DRAW0,Y,1:PRINTX,Y:NEXT:PRINT:PRINT
820 REMARQUE: Les nombress sont classes. Impression:
825 PRINT » 50″, » 100″, » 150″, » 200″, » 239″;
860 CALL#EDE0:GET E$:END

1000 REM================================================================
1020 REM ECRITURE EVOLUEE
1040 REM C D. VasilJevic
1060 REM avril 1985
1080 REM ORIC1
1090 REM THEORIC No 17, page 35
1100 REM================================================================
1110 : HIMEM#6DFF:HIRES:I=38912’CONDITIONS
1120 : REM——————————————————————————————————————————
1130 : REM ENTREE DES PARAMETRES
1140 :REM——————————————————————————————————————————
1150 :PRINT:INPUT »IMAGE AVEC SYMETRIE (O OU N) »;S$:CLS:PRINT
1160 : IF S$= »N »THEN1180
1170 : INPUT »PAR RAPPORT A X,Y OU O »;C$:CLS:PRINT
1180 : INPUT »Origine X,Y »;X,Y:CLS:X2=X:Y2=Y:PRINT
1190 : INPUT »ANGLE en RADIANS »;A:CLS:SN=SIN(A):CS=COS(A):PRINT
1200 : INPUT »Coefficient de LARGEUR »;L:CLS:L1=L:PRINT
1210 : INPUT »Coefficient d’ HAUTEUR »;H:CLS:H1=H:PRINT
1220 : INPUT »Coefficient de DEFORMATION X »;DX:CLS:PRINT
1230 : INPUT »Coefficient de DEFORMATION Y »;DY:CLS:PRINT
1240 : INPUT »Coefficient d’INCLINAISON X »;IX:CLS:PRINT
1250 : INPUT »Coefficient de DISTORSIONN Y »;IY:CLS:PRINT
1260 : INPUT »Coefficient de PERSPECTIVE P »;P:CLS:PRINT
1270 : INPUT »Coefficient de PRIORITE »;P1:CLS:PRINT
1280 : INPUT »EFFET D’ESCALIER X, Y »;EX,EY:CLS:PRINT
1290 : INPUT »ECRITURE INVERSE »;E:CLS:PRINT
1300 : INPUT »TEXT »;A$:CLS:FLAG=1:PL=0:D=1:PRINT
1310 :REM——————————————————————————————————————————
1320 :REM programme principal
1330 :REM——————————————————————————————————————————
1340 FORK=1TOLEN(A$)
1350 :IFP>0THENL=L1*K*P:H=H1*K*P
1360 :IFP<0THENL=L1/LEN(A$)*(LEN(A$)-K+1):H=H1/LEN(A$)*(LEN(A$)-K+1)
1370 :CA=ASC(MID$(A$,K,1)):CLS:PRINT
1380 :PRINT »Code ASCII en cours: « ,CA
1390 :FORJ=0TO7:J1=J*H*SN:J2=J*H*CS:I1=IX*J
1400 : IFP1=1THENGOSUB1550
1410 : V=PEEK(I+8*CA+J*FLAG+7*PL)
1420 : IFD=2THENGOSUB2020
1430 : FORC=3TO8:C1=(C-3)*L*CS:C2=(C-3)*L*SN:I2=IY*C
1440 : Z=INT(2^(8-C) )
1450 : IFV>=ZTHENGOSUB1900ELSE1460
1460 : NEXTC
1470 : NEXTJ
1480 : ONDGOSUB2080,2200
1490 NEXTK
1500 IFS$= »O »THEN1680
1510 INPUT »Autre text (O OU N) »;T$:IFT$= »O »THEN1150ELSEEND
1520 REM================================================================
1530 :REM effacement pour priorite
1540 :REM——————————————————————————————————————————
1550 FORC=3TO8:C1=(C-3)*L*CS:C2=(C-3)*L*SN:I2=IY*C
1560 :FORS=0TOL-1:FORT=0TOH-1
1570 : X1=C1-J1+S*CS-T*SN+I1+X+S*DX*CS-T*DY*SN
1580 : X1=INT((X1-INT(X1))*10/5+INT(X1))
1590 : Y1=C2+J2+S*SN+T*CS+I2+Y+S*DX*SN+T*DY*CS
1600 : Y1=INT((Y1-INT(Y1))*10/5+INT(Y1))
1610 : CURSETX1,Y1,0+E
1620 NEXTT,S,C:RETURN
1630 REM================================================================
1640 :REM parametres pour symetries
1650 :REM——————————————————————————————————————————
1660 :REM symetrie polaire
1670 REM———————————————————————–
1680 S$= »N »:IFC$= »O »THENA=A+PI:SN=SIN(A):CS=COS(A)
1690 IFP<>0THENL=L1:H=H1
1700 IFC$<> »O »THEN1770
1710 X=X2+(16*H-1)*SN+(2*L+1)*CS:Y=Y2-(16*H-1)*CS+(2*L+1)*SN
1720 : X=INT((X-INT(X))*10/5+INT(X))
1730 : Y=INT((Y-INT(Y))*10/5+INT(Y)):GOTO1340
1740 REM——————————————————————————————————————————
1750 :REM symetrie par x
1760 REM——————————————————————————————————————————
1780 : X=INT((X-INT(X))*10/5+INT(X))
1790 :Y=INT((Y-INT(Y))*10/5+INT(Y))
1800 IFC$= »X »THEN1340
1810 REM——————————————————————————————————————————
1820 :REM symetrie par y
1830 :REM——————————————————————————————————————————
1840 :X=X2-8*L*CS:Y=Y2-8*L*SN:D=2:FLAG=1:PL=0
1850 :X=INT((X-INT(X))*10/5+INT(X))
1860 : Y=INT((Y-INT(Y))*10/5+INT(Y)):GOTO1340
1870 REM===============================================================
1880 :REM ecriture
1890 :REM——————————————————————————————————————————
1900 :FORS=0TOL-1:FORT=0TOH-1
1910 : X1=C1-J1+S*CS-T*SN+I1+X+S*DX*CS-T*DY*SN
1920 : X1=INT((X1-INT(X1))*10/5+INT(X1))
1930 : Y1=C2+J2+S*SN+T*CS+I2+Y+S*DX*SN+T*DY*CS
1940 : Y1=INT((Y1-INT(Y1))*10/5+INT(Y1))
1950 : CURSETX1,Y1,3:B=POINT(X1,Y1)*-1:IFB<>ETHEN1980
1960 : CURSETX1,Y1,1+E
1970 :NEXTT,S
1980 :V=V-Z:RETURN
1990 REM===============================================================
2000 :REM caractere symetrique y
2010 :REM——————————————————————————————————————————
2020 V1=0:FORC=3TO8
2030 : Z=INT(2^(8-C)):IFV>=ZTHENV1=V1+INT(2^(C-3)):V=V-Z
2040 : NEXTC:V=V1:RETURN
2050 REM===============================================================
2060 :REM calcul coordonnees
2070 :REM——————————————————————————————————————————
2080 :IFP=0THENX=6*L*CS+X+EX
2090 :IFP>0THENX=6*L*CS+X+ABS(P-PL)*8*H1*SN+EX
2100 :IFP<0THENX=6*L*CS+X-(ABS(P)-PL)*8*SN+EX
2110 :IFP=0THENY=6*L*SN+Y+EY
2120 :IFP>0THENY=6*L*SN+Y-ABS(P-PL)*H1*8*CS+EY
2130 :IFP<0THENY=6*L*SN+Y+(ABS(P)-PL)*8*CS+EY
2140 : X=INT((X-INT(X))*10/5+INT(X))
2150 : Y=INT((Y-INT(Y))*10/5+INT(Y))
2160 :RETURN
2170 REM===============================================================
2180 :REM calcul coordonnees symetrie s y
2190 :REM——————————————————————————————————————————
2200 :IFP=0THENX=-6*L*CS+X-EX
2210 :IFP>0THENX=-6*(L+1)*CS+X+ABS(P-PL)*8*H1*SN-EX
2220 :IFP<0THENX=-6*(L-1)*CS+X-(ABS(P)-PL)*8*SN-EX
2230 :IFP=0THENY=-6*L*SN+Y+EY-SN
2240 : IFP>0THENY=-6*(L+1)*SN+Y-ABS( P-PL)*H1*8*CS+EY
2250 : IFP<0THENY=-6*(L-1)*SN+Y+(ABS(P)-PL*8*CS+EY
2260 : X=INT((X-INT(X))*10/5+INT(X))
2270 : Y=INT((Y-INT(Y))*10/5+INT(Y))
2280 : RETURN
2290 POKE#31,93:CALL#ED01:LLIST2200-2280

COMPACTAGE-DECOMPACTAGE HIRES
publié dans THEORIC N° 33, page40, juillet 1987

LISTING N° 5 – REPETITION – compactage

10 A=#7000:F=#7066:L=100:REPEAT:FOR A=A TO A+15:READ C$
20 K=VAL(« # »+C$):S=S+K+65536*(S+K>65535) :IF A<=F THEN POKE A,K
30 NEXT:READ D$:IF S=VAL(« # »+D$) THEN L=L+5:UNTIL A>F:END
40 PING:PRINT »Erreur ligne »;L
100 DATA A9,00,A0,A0,A2,40,85,00,84,01,85,02,86,03,AAl,A8,0637
105 DATA 86,04,84,05,B1,00,91,02,85,04,E8,E0,FF,F0,2C,A5,0D9F
110 DATA 00,18,69,01,85,00,A5,01,69,00,85,01,C9,BF,F0,2D,12E0
115 DATA B1,00,C5,04,F0,E4,20,51,70,E6,05,A5,05,18,65,02,1923
120 DATA 85,02,A5,03,69,00,85,03,18,90,C5,20,51,70,18,90,1E39
125 DATA CE,8A,E6,05,A4,05,91,02,A0,00,A2,00,60,A5,00,C9,24C8
130 DATA 41,B0,03,18,90,CA,60,00,00,00,00,00,00,00,00,00,278E

LISTING N° 6 – REPETITION – décompactage

10 A=#7100:F=#716E:L=100:REPEAT:FOR A=A TO A+15:READ C$
20 K=VAL(« # »+C$) :S=S+K+65536*(S+K>65535): IFA<=F THEN POKE A,K
30 NEXT:READ D$:IF S=VAL(« # »+D$) THEN L=L+5:UNTIL A>F:END
40 PING:PRINT »Erreur ligne »;L
100 DATA A9,00,A0,A0,A2,40,85,00,84,01,85,02,86,03,AA,A8,0637
105 DATA B1,02,85,04,C8,B1,02,88,C9,00,F0,25,85,05,A5,04,0C87
110 DATA 91,00,C8,C4,05,F0,03,18,90,F6,A5,00,18,65,05,85,12E6
115 DATA 00,A5,01,69,00,85,01,C9,BF,F0,2A,A6,05,E0,FF,F0,1A97
120 DATA 12,A5,02,18,69,02,85,02,A5,03,69,00,85,03,A0,00,1E93
125 DATA 18,90,BD,A5,02,18,69,01,85,02,A5,03,69,00,85,03,2341
130 DATA A0,01,18,90,B0,A5,00,C9,41,B0,03,18,90,D3,60,00,2977

LISTING N° 7 – TIERCE – compactage-décompactage

10 A=#7000:F=#7398:L=100:REPEAT:FOR A=A TO A+15:READ C$
20 K=VAL(« # »+C$):S=S+K+65536*(S+K>65535):IF A<=F THEN POKE A,K
30 NEXT:READ D$:IF S=VAL(« # »+D$) THEN L=L+5:UNTIL A>F:END
40 PING:PRINT »Ereur ligne » ;L
100 DATA 43,4F,4D,50,41,43,54,20,48,49,52,45,53,20,44,2E,0434
105 DATA 20,56,61,73,69,6C,6A,65,76,69,63,20,35,20,6F,63,09AB
110 DATA 74,6F,62,72,65,20,31,39,38,35,00,A0,00,40,41,BF,0E9E
115 DATA AD,2A,70,85,00,AC,2B,70,84,01,85,02,AE,2D,70,86,148E
120 DATA 03,A2,07,A9,00,95,03,CA,D0,F9,A0,00,B1,00,C9,40,1B68
125 DATA 90,22,F0,6A,C9,7F,90,60,F0,69,C9,C0,90,43,F0,68,24B9
130 DATA C9,FF,90,57,F0,67,46,69,6E,20,49,64,65,6E,74,69,2C59
135 DATA 66,69,63,2E,AA,20,7B,70,18,90,12,A9,00,A4,04,99,3212
140 DATA 05,00,C8,C0,04,F0,03,E6,04,60,4C,24,71,A9,00,C5,382F
145 DATA 09,F0,07,85,09,A9,1B,20,7D,70,8A,20,7D,70,4C,35,3DA6
150 DATA 71,38,E9,80,AA,20,7B,70,A9,01,C5,09,F0,07,85,09,446A
155 DATA A9,1B,20,7D,70,18,90,E2,4C,16,71,4C,1D,71,A2,19,4A2D
160 DATA 18,90,0C,A2,1A,18,90,07,A2,1C,18,90,02,A2,1D,20,4E93
165 DATA D5,70,18,90,0F,A9,00,A4,04,99,05,00,C8,C0,04,F0,54FA
170 DATA 4C,E6,04,60,8A,20,D7,70,E6,0A,A4,0A,C0,3F,F0,5A,5C68
175 DATA 88,B1,00,C8,D1,00,F0,F0,A4,04,A5,0A,99,05,00,A5,63B4
180 DATA 00,18,65,0A,85,00,A5,01,69,00,85,01,A9,00,85,0A,678D
185 DATA 20,B8,71,4C,4A,70,38,E9,40,AA,4C,8D,70,38,E9,C0,6F11
190 DATA AA,18,90,84,20,6E,71,A0,00,EA,4C,89,70,20,6E,71,75B4
195 DATA A0,00,18,90,AE,A5,00,18,69,01,85,00,A5,01,69,00,7A65
200 DATA 85,01,CD,2F,70,F0,1B,4C,4A,70,AA,98,A4,04,99,05,80F0
205 DATA 00,C8,C0,04,F0,05,E6,04,18,90,62,20,6E,71,A0,00,8704
210 DATA 18,90,5A,A5,00,CD,2E,70,B0,03,4C,4A,70,60,86,04,8CB9
215 DATA A2,04,06,08,06,08,66,07,66,08,66,07,66,08,06,07,8F3E
220 DATA CA,D0,FB,A2,04,66,06,66,07,CA,D0,F9,A9,03,25,06,96BC
225 DATA 06,05,06,05,18,65,05,85,06,A0,02,B9,06,00,91,02,99D3
230 DATA 88,10,F8,A5,02,18,69,03,85,02,A5,03,69,00,85,03,9EAE
235 DATA A9,00,A6,04,85,04,A8,60,A4,04,4C,82,70,A5,00,18,A435
240 DATA 65,0A,85,00,A5,01,69,00,85,01,CD,2F,70,F0,10,A9,A9D3
245 DATA 00,85,0A,A8,8A,D1,00,F0,03,4C,4A,70,4C,E8,70,A5,B0A7
250 DATA 00,CD,2E,70,B0,88,18,90,E6,55,55,55,55,55,55,55,B72B
255 DATA 55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,BC7B
260 DATA 44,45,43,4F,4D,50,43,54,48,49,52,45,53,20,44,2E,C0D7
265 DATA 20,56,61,73,69,6C,6A,65,76,69,63,20,35,20,6F,63,C64E
270 DATA 74,6F,62,72,65,20,31,39,38,35,00,A0,00,40,41,BF,CB41
275 DATA AD,2A,72,85,00,AC,2B,72,84,01,85,02,AE,2D,72,86,D137
280 DATA 03,A2,07,A9,00,95,03,CA,D0,F9,A0,02,B1,02,99,06,D7AB
285 DATA 00,88,10,F8,20,4A,73,A4,04,B9,05,00,C9,00,F0,44,DD7B
290 DATA C9,1B,F0,37,A6,09,C5,01,F0,2B,18,69,40,A0,00,91,E408
295 DATA 00,A5,00,18,69,01,85,00,A5,01,69,00,85,01,CD,2F,E845
300 DATA 72,F0,1E,A5,0A,C9,3F,F0,3A,A4,04,C8,C0,04,F0,BA,F084
305 DATA E6,04,18,90,C2,18,69,C0,18,90,D2,20,F0,72,18,90,F7BD
310 DATA E8,18,90,64,20,FE,72,A4,04,B9,05,00,C9,1B,F0,16,FE91
315 DATA C9,19,F0,28,C9,1A,F0,29,C9,1C,F0,2A,C9,1D,F0,2B,0687·
320 DATA 18,90,09,18,90,52,20,1B,00,20,FE,72,A6,09,E0,01,0B8D
325 DATA F0,03,18,90,98,18,6D,80,00,18,90,91,A2,40,18,90,1188
330 DATA 37,A2,7F,18,90,32,A2,C0,18,90,2D,A2,FF,18,90,28,1862
335 DATA A2,00,E4,09,F0,03,86,09,60,A2,01,86,09,60,A4,04,1E0D
340 DATA C8,C0,04,F0,37,E6,04,60,A5,00,CD,2E,72,B0,2C,A5,259D
345 DATA 0A,C9,3F,F0,03,4C,4A,72,20,FE,72,A4,04,B9,05,00,2BA0
350 DATA 85,0A,8A,A4,0A,88,91,00,88,10,FB,A5,00,18,65,0A,313F
355 DATA 85,00,A5,01,69,00,85,01,4C,7E,72,60,A0,02,B1,02,364A
360 DATA 99,06,00,88,10,F8,20,4A,73,60,18,90,40,EA,26,06,3BB4
365 DATA 26,05,CA,D0,F9,A2,03,26,06,CA,D0,FB,A2,04,26,07,42AB
370 DATA 26,06,CA,D0,F9,A2,04,46,07,CA,D0,FB,A2,02,26,08,49C4
375 DATA 26,07,CA,D0,F9,46,08,46,08,A5,02,18,69,03,85,02,4ED2
380 DATA A5,03,69,00,85,03,A0,00,A6,04,84,04,60,A9,00,85,53CB
385 DATA 05,86,04,A2,06,18,90,B6,55,00,00,00,00,00,00,00,56B5

ECHANGE SYMETRIQUE publiée dans THEORICUE No 21, page 18

10 HIMEM #6FFF:A=#7003:F=#71D3:L=100:REPEAT:FOR A=A TO A+15:READ C$
20 K=VAL(« # »+C$):S=S+K+65536*(S+K>65535) :IF A<=F THEN POKE A,K
30 NEXT:READ D$:IF S=VAL(« # »+D$) THEN L=L+10:S=0:UNTIL A>F:END
40 PING:PRINT »Erreur ligne »;L
100 DATA 45,43,48,41,4E,47,45,20,53,59,4D,45,54,52,49,51,0489
110 DATA 55,45,20,48,49,52,45,53,20,44,2E,20,56,61,73,69,047A
120 DATA 6C,6A,65,76,69,63,20,30,33,20,44,65,63,20,31,39,04B6
130 DATA 38,35,20,00,A0,27,A0,00,A0,27,A0,20,0A,D8,E0,03,0540
140 DATA 90,10,A9,F9,A0,CD,20,ED,CB,20,F8,C5,38,E9,30,18,08CD
150 DATA 90,EC,8A,85,00,AD,36,70,85,01,AD,37,70,85,02,AD,06EC
160 DATA 38,70,85,03,AD,39,70,85,04,AD,3A,70,85,07,AD,3B,05DA
170 DATA 70,85,08,AD,3C,70,85,09,AD,3D,70,85,0A,A9,28,85,0623
180 DATA 06,A9,C8,85,05,A5,05,85,7A,AA,A9,00,85,78,85,79,06F8
190 DATA 18,A5,78,69,28,85,78,A5,79,69,00,85,79,CA,D0,F1,07D3
200 DATA A5,00,C9,00,F0,42,A9,26,85,06,A5,01,18,69,02,85,05A8
210 DATA 01,A5, 02,69,00,85,02,A5,07,18,69,02,85,07,A5,08,0400
220 DATA 69,00,85,08,A5,00,C9,02,F0,1E,A9,24,85,06,A5,03,0574
230 DATA 38,E9,02,85,03,A5,04,E9,00,85,04,A5,09,38,E9,02,0597
240 DATA 85,09,A5,0A,E9,00,85,0A,46,06,A2,00,A0,00,B1,01,04F5
250 DATA 20,32,71,8D,00,70,20,3F,71,8D,01,70,B1,03,20,32,0494
260 DATA 71,8D,00,70,20,3F,71,91,07,AD,01,70,91,09,20,5E,050C
270 DATA 71,C6,05,D0,D7,20,93,71,C6,06,D0,CE,60,A6,00,E0,0857
280 DATA 02,F0,07,8D,00,70,20,3F,71,60,29,80,09,40,60,AA,0522
290 DATA 29,40,C9,40,F0,04,8A,18,90,E3,8A,60,AD,00,70,29,06AB
300 DATA C0,8D,02,70,AD,00,70,29,3F,A2,06,6A,2E,00,70,CA,05BE
310 DATA D0,F9,AD,00,70,29,3F,0D,02,70,60,A5,01,18,69,28,057C
320 DATA 85,01,A5,02,69,00,85,02,A5,07,18,69,28,85,07,A5,04A3
330 DATA 08,69,00,85,08,A5,03,18,69,28,85,03,A5,04,69,00,03E9
340 DATA 85,04,A5,09,18,69,28,85,09,A5,0A,69,00,85,0A,60,0475
350 DATA A5,7A,85,05,C6,78,A5,01,38,E5,78,85,01,A5,02,E5,0734
360 DATA 79,85,02,A5,07,38,E5,78,85,07,A5,08,E5,79,85,08,0665
370 DATA E6,78,E6,78,A5,03,38,E5,78,85,03,A5,04,E5,79,85,080D
380 DATA 04,A5,09,38,E5,78,85,09,A5,0A,E5,79,85,0A,C6,78,06AF
390 DATA 60,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,0060

 

 

Publicités