summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/profcollege/metapost
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/profcollege/metapost')
-rw-r--r--macros/latex/contrib/profcollege/metapost/PfCLabyNombre.mp211
-rw-r--r--macros/latex/contrib/profcollege/metapost/PfCMosaique.mp446
-rw-r--r--macros/latex/contrib/profcollege/metapost/PfCScratch.mp17
-rw-r--r--macros/latex/contrib/profcollege/metapost/PfCScratchpdf.mp17
4 files changed, 689 insertions, 2 deletions
diff --git a/macros/latex/contrib/profcollege/metapost/PfCLabyNombre.mp b/macros/latex/contrib/profcollege/metapost/PfCLabyNombre.mp
new file mode 100644
index 0000000000..e6877ef34e
--- /dev/null
+++ b/macros/latex/contrib/profcollege/metapost/PfCLabyNombre.mp
@@ -0,0 +1,211 @@
+%Pile des cases du chemin
+pair PileChemin[];
+numeric indiceChemin;
+indiceChemin=0;
+
+vardef RAZPileChemin=
+ pair PileChemin[];
+ indiceChemin:=0;
+enddef;
+
+def PushChemin(expr tt)=
+ if indiceChemin<1:
+ PileChemin[1]:=tt;
+ indiceChemin:=1;
+ else:
+ PileChemin[indiceChemin+1]:=tt;
+ indiceChemin:=indiceChemin+1;
+ fi;
+enddef;
+
+def PopChemin=
+ if indiceChemin<1:
+ RAZPileChemin;
+ for k=-1 upto LargeurLaby:
+ for l=-1 upto LongueurLaby:
+ if (k=-1) or (k=LargeurLaby) or (l=-1) or (l=LongueurLaby):
+ CaseExploree[k][l]:=true;
+ else:
+ CaseExploree[k][l]:=false;
+ fi;
+ endfor;
+ endfor;
+ Mobile:=Depart;
+ PushChemin((choixligneD,choixcolonneD));
+ CaseExploree[choixligneD][choixcolonneD]:=true;
+ VoisinDispo(choixligneD,choixcolonneD);
+ else:
+ if indiceChemin>0:
+ CaseExploree[xpart(PileChemin[indiceChemin])][ypart(PileChemin[indiceChemin])]:=true;
+ fi;
+ indiceChemin:=indiceChemin-1;
+ fi;
+enddef;
+
+%Pile des cases voisines de la case parcourue
+pair PileVoisin[];
+numeric indiceVoisin;
+indiceVoisin=0;
+
+vardef RAZPileVoisin=
+ indiceVoisin:=0;
+enddef;
+
+def PushVoisin(expr tt)=
+ if indiceVoisin<1:
+ PileVoisin[1]:=tt;
+ indiceVoisin:=1;
+ else:
+ PileVoisin[indiceVoisin+1]:=tt;
+ indiceVoisin:=indiceVoisin+1;
+ fi;
+enddef;
+
+def PopVoisin=
+ if indiceVoisin<0:
+ %message("La pile n'existe pas");
+ else:
+ indiceVoisin:=indiceVoisin-1;
+ fi;
+enddef;
+
+vardef VoisinDispo(expr la,lo)=
+ RAZPileVoisin;
+ numeric nbvoisin;
+ nbvoisin=0;
+ if (la>-1) and (la<LargeurLaby) and (lo>-1) and (lo<LongueurLaby):
+ if CaseExploree[la+1][lo]=false:
+ nbvoisin:=nbvoisin+1;
+ PushVoisin((la+1,lo));
+ fi;
+ if CaseExploree[la-1][lo]=false:
+ nbvoisin:=nbvoisin+1;
+ PushVoisin((la-1,lo));
+ fi;
+ if CaseExploree[la][lo+1]=false:
+ nbvoisin:=nbvoisin+1;
+ PushVoisin((la,lo+1));
+ fi;
+ if CaseExploree[la][lo-1]=false:
+ nbvoisin:=nbvoisin+1;
+ PushVoisin((la,lo-1));
+ fi;
+ fi;
+enddef;
+
+vardef InitialisationLabyrinthe(expr long,larg)=
+ LargeurLaby:=larg;
+ LongueurLaby:=long;
+ pair M[][],N[][];%centre de la case, coinbg de la case
+ boolean CaseExploree[][];%Case Exploree ou pas
+ %on initialise les cases comme non explorées pour celles qui sont à l'intérieur du labyrinthe
+ %n=0;
+ for k=-1 upto larg:
+ for l=-1 upto long:
+ M[k][l]:=u*(0.5,-0.5)+u*(l,-k);
+ N[k][l]:=u*(l,-k-1);
+ if (k=-1) or (k=larg) or (l=-1) or (l=long):
+ CaseExploree[k][l]:=true;
+ else:
+ CaseExploree[k][l]:=false;
+ fi;
+ endfor;
+ endfor;
+enddef;
+
+vardef TraceLabyrinthe=
+ save $;
+ picture $;
+ $=image(
+ if Murs:
+ for k=1 upto LargeurLaby:
+ trace murgauche shifted(u*(0,-k));
+ endfor;
+ for k=0 upto LongueurLaby-1:
+ trace murhaut shifted(u*(k,-1));
+ endfor;
+ for k=1 upto LargeurLaby:
+ trace murdroit shifted(u*(LongueurLaby-1,-k));
+ endfor;
+ for k=0 upto LongueurLaby-1:
+ trace murbas shifted(u*(k,-LargeurLaby));
+ endfor;
+ for k=1 upto LargeurLaby-1:
+ for l=1 upto LongueurLaby-1:
+ trace Separation shifted(u*(l,-k));
+ endfor;
+ endfor;
+ else:
+ for k=0 upto LargeurLaby:
+ trace u*(0,0-k)--u*(LongueurLaby,0-k);
+ endfor;
+ for k=0 upto LongueurLaby:
+ trace u*(0+k,0)--u*(0+k,-LargeurLaby);
+ endfor;
+ fi;
+ );
+ $
+enddef;
+
+vardef murgauche=
+ save $;
+ picture $;
+ path pl[];
+ $=image(
+ %pl1=(0,0)--u*(0.15,0)--u*(0.15,0.2){dir180}..u*(0.08+uniformdeviate(0.05),0.2+uniformdeviate(0.1))..u*(0.09+uniformdeviate(0.015),0.3+uniformdeviate(0.2))..u*(0.08+uniformdeviate(0.04),0.5+uniformdeviate(0.2))..{dir0}u*(0.15,0.8)--u*(0.15,1)--u*(0,1)--cycle;
+ pl1=(0,0)--u*(0.1,0)..u*(0.02+uniformdeviate(0.05),0.25)..u*(0.1-uniformdeviate(0.03),0.5)..u*(0.02+uniformdeviate(0.05),0.75)..u*(0.1,1)--u*(0,1)--cycle;
+ remplis pl[1];
+ trace pl[1];
+ );
+ $
+enddef;%ok
+
+vardef murhaut=
+ save $;
+ picture $;
+ path pl[];
+ $=image(
+ pl1=u*(0,0.8)--u*(0,1)--u*(1,1)--u*(1,0.8)..u*(0.8+uniformdeviate(0.1),0.8+uniformdeviate(0.1))..u*(0.4+uniformdeviate(0.2),0.8-uniformdeviate(0.1))..u*(0.2+uniformdeviate(0.2),0.8+uniformdeviate(0.1))--cycle;
+ remplis pl[1];
+ trace pl[1];
+ );
+ $
+enddef;
+
+vardef murdroit=
+ save $;
+ picture $;
+ path pl[];
+ $=image(
+ pl1=u*(1,0)--u*(1-0.15,0)--u*(1-0.15,0.2){dir180}..u*(1-0.08+uniformdeviate(0.05),0.2+uniformdeviate(0.1))..u*(1-0.09+uniformdeviate(0.015),0.3+uniformdeviate(0.2))..u*(1-0.08+uniformdeviate(0.04),0.5+uniformdeviate(0.2))..{dir0}u*(1-0.15,0.8)--u*(1-0.15,1)--u*(1-0,1)--cycle;
+ remplis pl[1];
+ trace pl[1];
+ );
+ $
+enddef;%ok
+
+vardef murbas=
+ save $;
+ picture $;
+ path pl[];
+ $=image(
+ pl1=u*(0,0.2)--u*(0,0)--u*(1,0)--u*(1,0.2)..u*(0.8+uniformdeviate(0.1),0.2+uniformdeviate(0.1))..u*(0.4+uniformdeviate(0.2),0.2-uniformdeviate(0.1))..u*(0.2+uniformdeviate(0.2),0.2+uniformdeviate(0.1))--cycle;
+ remplis pl[1];
+ trace pl[1];
+ );
+ $
+enddef;
+
+vardef Separation=
+ save $;
+ picture $;
+ path pl[];
+ $=image(
+ pl1=u*(0.2,0)..u*(0.05+uniformdeviate(0.05),0.05+uniformdeviate(0.05))..u*(0,0.2)..u*(-0.1+uniformdeviate(0.05),0.05+uniformdeviate(0.05))..u*(-0.2,0)..u*(-0.1+uniformdeviate(0.05),-0.05-uniformdeviate(0.05))..u*(0,-0.2)..u*(0.05+uniformdeviate(0.05),-0.05-uniformdeviate(0.05))..cycle;
+ remplis pl[1];
+ trace pl[1];
+ );
+ $
+enddef;
+
+endinput
diff --git a/macros/latex/contrib/profcollege/metapost/PfCMosaique.mp b/macros/latex/contrib/profcollege/metapost/PfCMosaique.mp
new file mode 100644
index 0000000000..a776732aa6
--- /dev/null
+++ b/macros/latex/contrib/profcollege/metapost/PfCMosaique.mp
@@ -0,0 +1,446 @@
+%Premier ensemble de mosaique
+pair A[],O;
+path Bc[];
+picture MosaiqueUn[];
+
+for k=1 upto 8:
+ A1=u*(0,0);
+ A3-A1=u*(1,0);
+ A2=iso(A1,A3);
+ A5=rotation(A1,A3,-90);
+ A4=iso(A3,A5);
+ A7-A5=A1-A3;
+ A6=iso(A5,A7);
+ A8=iso(A7,A1);
+ O=iso(A1,A5);
+endfor;
+
+A9=A1;
+
+for k=1 upto 8:
+ Bc[k]=polygone(A[k],A[k+1],O);
+endfor;
+
+MosaiqueUn[0]=image(
+ drawoptions(withcolor gris);
+ for j=1 upto 4:
+ trace segment(A[j],A[j+4]);
+ endfor;
+ drawoptions();
+ trace polygone(A1,A3,A5,A7) withcolor 0.5white;
+ );
+
+for l=1 upto 8:
+ MosaiqueUn[l]=image(
+ remplis Bc[l];
+ drawoptions(withcolor gris);
+ for j=1 upto 4:
+ trace segment(A[j],A[j+4]);
+ endfor;
+ drawoptions();
+ trace polygone(A1,A3,A5,A7) withcolor 0.5white;
+ );
+endfor;
+
+p:=8;
+
+for l=1 upto 7:
+ for k=l+1 upto 8:
+ p:=p+1;
+ MosaiqueUn[p]=image(
+ remplis Bc[l] withcolor noir;
+ remplis Bc[k] withcolor noir;
+ drawoptions(withcolor gris);
+ for j=1 upto 4:
+ trace segment(A[j],A[j+4]);
+ endfor;
+ drawoptions();
+ trace polygone(A1,A3,A5,A7) withcolor 0.5white;
+ );
+ endfor;
+endfor;
+
+for l=1 upto 6:
+ for k=l+1 upto 7:
+ for m=k+1 upto 8:
+ p:=p+1;
+ MosaiqueUn[p]=image(
+ remplis Bc[l] withcolor noir;
+ remplis Bc[k] withcolor noir;
+ remplis Bc[m] withcolor noir;
+ drawoptions(withcolor gris);
+ for j=1 upto 4:
+ trace segment(A[j],A[j+4]);
+ endfor;
+ drawoptions();
+ trace polygone(A1,A3,A5,A7) withcolor 0.5white;
+ );
+ endfor;
+ endfor;
+endfor;
+
+for l=1 upto 5:
+ for k=l+1 upto 6:
+ for m=k+1 upto 7:
+ for n=m+1 upto 8:
+ p:=p+1;
+ MosaiqueUn[p]=image(
+ remplis Bc[l] withcolor noir;
+ remplis Bc[k] withcolor noir;
+ remplis Bc[m] withcolor noir;
+ remplis Bc[n] withcolor noir;
+ drawoptions(withcolor gris);
+ for j=1 upto 4:
+ trace segment(A[j],A[j+4]);
+ endfor;
+ drawoptions();
+ trace polygone(A1,A3,A5,A7) withcolor 0.5white;
+ );
+ endfor;
+ endfor;
+ endfor;
+endfor;
+
+for l=1 upto 4:
+ for k=l+1 upto 5:
+ for m=k+1 upto 6:
+ for n=m+1 upto 7:
+ for o=n+1 upto 8:
+ p:=p+1;
+ MosaiqueUn[p]=image(
+ remplis Bc[l] withcolor noir;
+ remplis Bc[k] withcolor noir;
+ remplis Bc[m] withcolor noir;
+ remplis Bc[n] withcolor noir;
+ remplis Bc[o] withcolor noir;
+ drawoptions(withcolor gris);
+ for j=1 upto 4:
+ trace segment(A[j],A[j+4]);
+ endfor;
+ drawoptions();
+ trace polygone(A1,A3,A5,A7) withcolor 0.5white;
+ );
+ endfor;
+ endfor;
+ endfor;
+ endfor;
+endfor;
+
+for l=1 upto 3:
+ for k=l+1 upto 4:
+ for m=k+1 upto 5:
+ for n=m+1 upto 6:
+ for o=n+1 upto 7:
+ for r=o+1 upto 8:
+ p:=p+1;
+ MosaiqueUn[p]=image(
+ remplis Bc[l] withcolor noir;
+ remplis Bc[k] withcolor noir;
+ remplis Bc[m] withcolor noir;
+ remplis Bc[n] withcolor noir;
+ remplis Bc[o] withcolor noir;
+ remplis Bc[r] withcolor noir;
+ drawoptions(withcolor gris);
+ for j=1 upto 4:
+ trace segment(A[j],A[j+4]);
+ endfor;
+ drawoptions();
+ trace polygone(A1,A3,A5,A7) withcolor 0.5white;
+ );
+ endfor;
+ endfor;
+ endfor;
+ endfor;
+ endfor;
+endfor;
+
+for l=1 upto 2:
+ for k=l+1 upto 3:
+ for m=k+1 upto 4:
+ for n=m+1 upto 5:
+ for o=n+1 upto 6:
+ for r=o+1 upto 7:
+ for s=r+1 upto 8:
+ p:=p+1;
+ MosaiqueUn[p]=image(
+ remplis Bc[l] withcolor noir;
+ remplis Bc[k] withcolor noir;
+ remplis Bc[m] withcolor noir;
+ remplis Bc[n] withcolor noir;
+ remplis Bc[o] withcolor noir;
+ remplis Bc[r] withcolor noir;
+ remplis Bc[s] withcolor noir;
+ drawoptions(withcolor gris);
+ for j=1 upto 4:
+ trace segment(A[j],A[j+4]);
+ endfor;
+ drawoptions();
+ trace polygone(A1,A3,A5,A7) withcolor 0.5white;
+ );
+ endfor;
+ endfor;
+ endfor;
+ endfor;
+ endfor;
+ endfor;
+endfor;
+
+for l=1 upto 1:
+ for k=l+1 upto 2:
+ for m=k+1 upto 3:
+ for n=m+1 upto 4:
+ for o=n+1 upto 5:
+ for r=o+1 upto 6:
+ for s=r+1 upto 7:
+ for t=s+1 upto 8:
+ p:=p+1;
+ MosaiqueUn[p]=image(
+ remplis Bc[l] withcolor noir;
+ remplis Bc[k] withcolor noir;
+ remplis Bc[m] withcolor noir;
+ remplis Bc[n] withcolor noir;
+ remplis Bc[o] withcolor noir;
+ remplis Bc[r] withcolor noir;
+ remplis Bc[s] withcolor noir;
+ remplis Bc[t] withcolor noir;
+ drawoptions(withcolor gris);
+ for j=1 upto 4:
+ trace segment(A[j],A[j+4]);
+ endfor;
+ drawoptions();
+ trace polygone(A1,A3,A5,A7) withcolor 0.5white;
+ );
+ endfor;
+ endfor;
+ endfor;
+ endfor;
+ endfor;
+ endfor;
+ endfor;
+endfor;
+
+% Deuxième jeu de mosaique
+pair A[],O;
+path Bc[];
+picture MosaiqueDeux[];
+
+for k=1 upto 8:
+ A1=u*(0,0);
+ A3-A1=u*(1,0);
+ A2=iso(A1,A3);
+ A5=rotation(A1,A3,-90);
+ A4=iso(A3,A5);
+ A7-A5=A1-A3;
+ A6=iso(A5,A7);
+ A8=iso(A7,A1);
+ O=iso(A1,A5);
+endfor;
+
+A9=A1;
+
+Bc[1]=polygone(A[1],A[2],A[8]);
+Bc[2]=polygone(A[8],A[2],O);
+Bc[3]=polygone(A[4],A[2],O);
+Bc[4]=polygone(A[3],A[2],A[4]);
+Bc[5]=polygone(A[5],A[4],A[6]);
+Bc[6]=polygone(A[4],A[6],O);
+Bc[7]=polygone(A[6],A[8],O);
+Bc[8]=polygone(A[6],A[7],A[8]);
+
+MosaiqueDeux[0]=image(
+ drawoptions(withcolor gris);
+ trace polygone(A2,A4,A6,A8);
+ trace segment(A8,A4);
+ trace segment(A6,A2);
+ drawoptions();
+ trace polygone(A1,A3,A5,A7) withcolor 0.5white;
+ );
+
+for l=1 upto 8:
+ MosaiqueDeux[l]=image(
+ remplis Bc[l];
+ drawoptions(withcolor gris);
+ trace polygone(A2,A4,A6,A8);
+ trace segment(A8,A4);
+ trace segment(A6,A2);
+ drawoptions();
+ trace polygone(A1,A3,A5,A7) withcolor 0.5white;
+ );
+endfor;
+
+p:=8;
+
+for l=1 upto 7:
+ for k=l+1 upto 8:
+ p:=p+1;
+ MosaiqueDeux[p]=image(
+ remplis Bc[l] withcolor noir;
+ remplis Bc[k] withcolor noir;
+ drawoptions(withcolor gris);
+ trace polygone(A2,A4,A6,A8);
+ trace segment(A8,A4);
+ trace segment(A6,A2);
+ drawoptions();
+ trace polygone(A1,A3,A5,A7) withcolor 0.5white;
+ );
+ endfor;
+endfor;
+
+for l=1 upto 6:
+ for k=l+1 upto 7:
+ for m=k+1 upto 8:
+ p:=p+1;
+ MosaiqueDeux[p]=image(
+ remplis Bc[l] withcolor noir;
+ remplis Bc[k] withcolor noir;
+ remplis Bc[m] withcolor noir;
+ drawoptions(withcolor gris);
+ trace polygone(A2,A4,A6,A8);
+ trace segment(A8,A4);
+ trace segment(A6,A2);
+ drawoptions();
+ trace polygone(A1,A3,A5,A7) withcolor 0.5white;
+ );
+ endfor;
+ endfor;
+endfor;
+
+for l=1 upto 5:
+ for k=l+1 upto 6:
+ for m=k+1 upto 7:
+ for n=m+1 upto 8:
+ p:=p+1;
+ MosaiqueDeux[p]=image(
+ remplis Bc[l] withcolor noir;
+ remplis Bc[k] withcolor noir;
+ remplis Bc[m] withcolor noir;
+ remplis Bc[n] withcolor noir;
+ drawoptions(withcolor gris);
+trace polygone(A2,A4,A6,A8);
+ trace segment(A8,A4);
+ trace segment(A6,A2);
+ drawoptions();
+ trace polygone(A1,A3,A5,A7) withcolor 0.5white;
+ );
+ endfor;
+ endfor;
+ endfor;
+endfor;
+
+for l=1 upto 4:
+ for k=l+1 upto 5:
+ for m=k+1 upto 6:
+ for n=m+1 upto 7:
+ for o=n+1 upto 8:
+ p:=p+1;
+ MosaiqueDeux[p]=image(
+ remplis Bc[l] withcolor noir;
+ remplis Bc[k] withcolor noir;
+ remplis Bc[m] withcolor noir;
+ remplis Bc[n] withcolor noir;
+ remplis Bc[o] withcolor noir;
+ drawoptions(withcolor gris);
+trace polygone(A2,A4,A6,A8);
+ trace segment(A8,A4);
+ trace segment(A6,A2);
+ drawoptions();
+ trace polygone(A1,A3,A5,A7) withcolor 0.5white;
+ );
+ endfor;
+ endfor;
+ endfor;
+ endfor;
+endfor;
+
+for l=1 upto 3:
+ for k=l+1 upto 4:
+ for m=k+1 upto 5:
+ for n=m+1 upto 6:
+ for o=n+1 upto 7:
+ for r=o+1 upto 8:
+ p:=p+1;
+ MosaiqueDeux[p]=image(
+ remplis Bc[l] withcolor noir;
+ remplis Bc[k] withcolor noir;
+ remplis Bc[m] withcolor noir;
+ remplis Bc[n] withcolor noir;
+ remplis Bc[o] withcolor noir;
+ remplis Bc[r] withcolor noir;
+ drawoptions(withcolor gris);
+trace polygone(A2,A4,A6,A8);
+ trace segment(A8,A4);
+ trace segment(A6,A2);
+ drawoptions();
+ trace polygone(A1,A3,A5,A7) withcolor 0.5white;
+ );
+ endfor;
+ endfor;
+ endfor;
+ endfor;
+ endfor;
+endfor;
+
+for l=1 upto 2:
+ for k=l+1 upto 3:
+ for m=k+1 upto 4:
+ for n=m+1 upto 5:
+ for o=n+1 upto 6:
+ for r=o+1 upto 7:
+ for s=r+1 upto 8:
+ p:=p+1;
+ MosaiqueDeux[p]=image(
+ remplis Bc[l] withcolor noir;
+ remplis Bc[k] withcolor noir;
+ remplis Bc[m] withcolor noir;
+ remplis Bc[n] withcolor noir;
+ remplis Bc[o] withcolor noir;
+ remplis Bc[r] withcolor noir;
+ remplis Bc[s] withcolor noir;
+ drawoptions(withcolor gris);
+trace polygone(A2,A4,A6,A8);
+ trace segment(A8,A4);
+ trace segment(A6,A2);
+ drawoptions();
+ trace polygone(A1,A3,A5,A7) withcolor 0.5white;
+ );
+ endfor;
+ endfor;
+ endfor;
+ endfor;
+ endfor;
+ endfor;
+endfor;
+
+for l=1 upto 1:
+ for k=l+1 upto 2:
+ for m=k+1 upto 3:
+ for n=m+1 upto 4:
+ for o=n+1 upto 5:
+ for r=o+1 upto 6:
+ for s=r+1 upto 7:
+ for t=s+1 upto 8:
+ p:=p+1;
+ MosaiqueDeux[p]=image(
+ remplis Bc[l] withcolor noir;
+ remplis Bc[k] withcolor noir;
+ remplis Bc[m] withcolor noir;
+ remplis Bc[n] withcolor noir;
+ remplis Bc[o] withcolor noir;
+ remplis Bc[r] withcolor noir;
+ remplis Bc[s] withcolor noir;
+ remplis Bc[t] withcolor noir;
+ drawoptions(withcolor gris);
+ trace polygone(A2,A4,A6,A8);
+ trace segment(A8,A4);
+ trace segment(A6,A2);
+ drawoptions();
+ trace polygone(A1,A3,A5,A7) withcolor 0.5white;
+ );
+ endfor;
+ endfor;
+ endfor;
+ endfor;
+ endfor;
+ endfor;
+ endfor;
+endfor;
diff --git a/macros/latex/contrib/profcollege/metapost/PfCScratch.mp b/macros/latex/contrib/profcollege/metapost/PfCScratch.mp
index 75a0e0edcc..c3a41e3eb4 100644
--- a/macros/latex/contrib/profcollege/metapost/PfCScratch.mp
+++ b/macros/latex/contrib/profcollege/metapost/PfCScratch.mp
@@ -2939,6 +2939,21 @@ vardef OpDiv(expr pasun,pasdeux)=
Oop
enddef;
+vardef OpModulo(expr pasun,pasdeux)=
+ save Oop; picture Oop;
+ save TAao; path TAao;
+ save LOPop; picture LOPop;
+ LOPop=ColleBoxNew(if string pasun : OvalNb(pasun) else: pasun fi,"modulo",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi);
+ TAao=OvalBox(LOPop);
+ Oop=image(
+ fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ draw LOPop;
+ draw TAao if print=false : withcolor coefprint*white fi;
+ );
+ Oop:=Oop shifted(-center Oop);
+ Oop
+enddef;
+
vardef OpAlea(expr pasun,pasdeux)=
save Oop; picture Oop;
save TAao; path TAao;
@@ -3243,7 +3258,7 @@ vardef TestCapCouleurs(expr pasun,pasdeux)=
save $; picture $;
save TAa; path TAa;
save LTa; picture LTa;
- LTa=ColleBoxNew("couleur",OvalCouleur(redpart(pasun),greenpart(pasun),bluepart(pasun)),"touché",OvalCouleur(redpart(pasdeux),greenpart(pasdeux),bluepart(pasdeux)),"?");
+ LTa=ColleBoxNew("couleur",OvalCouleur(redpart(pasun),greenpart(pasun),bluepart(pasun)),"touche",OvalCouleur(redpart(pasdeux),greenpart(pasdeux),bluepart(pasdeux)),"?");
TAa=DiamondBox(LTa);
$=image(
fill TAa if print=false : withcolor CapteurTrois else : withcolor coefprint*white fi;
diff --git a/macros/latex/contrib/profcollege/metapost/PfCScratchpdf.mp b/macros/latex/contrib/profcollege/metapost/PfCScratchpdf.mp
index f3800b3d99..b9edf3873f 100644
--- a/macros/latex/contrib/profcollege/metapost/PfCScratchpdf.mp
+++ b/macros/latex/contrib/profcollege/metapost/PfCScratchpdf.mp
@@ -2971,6 +2971,21 @@ vardef OpDiv(expr pasun,pasdeux)=
Oop
enddef;
+vardef OpModulo(expr pasun,pasdeux)=
+ save Oop; picture Oop;
+ save TAao; path TAao;
+ save LOPop; picture LOPop;
+ LOPop=ColleBoxNew(if string pasun : OvalNb(pasun) else: pasun fi,"modulo",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi);
+ TAao=OvalBox(LOPop);
+ Oop=image(
+ fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ draw LOPop;
+ draw TAao if print=false : withcolor coefprint*white fi;
+ );
+ Oop:=Oop shifted(-center Oop);
+ Oop
+enddef;
+
vardef OpAlea(expr pasun,pasdeux)=
save Oop; picture Oop;
save TAao; path TAao;
@@ -3275,7 +3290,7 @@ vardef TestCapCouleurs(expr pasun,pasdeux)=
save $; picture $;
save TAa; path TAa;
save LTa; picture LTa;
- LTa=ColleBoxNew("couleur",OvalCouleur(redpart(pasun),greenpart(pasun),bluepart(pasun)),"touché",OvalCouleur(redpart(pasdeux),greenpart(pasdeux),bluepart(pasdeux)),"?");
+ LTa=ColleBoxNew("couleur",OvalCouleur(redpart(pasun),greenpart(pasun),bluepart(pasun)),"touche",OvalCouleur(redpart(pasdeux),greenpart(pasdeux),bluepart(pasdeux)),"?");
TAa=DiamondBox(LTa);
$=image(
fill TAa if print=false : withcolor CapteurTrois else : withcolor coefprint*white fi;