From fae1f4c4c570d0d2b318d23b148a6a87d88c0762 Mon Sep 17 00:00:00 2001 From: pourchot Date: Fri, 27 Oct 2023 14:58:17 +0200 Subject: [PATCH] 27 Octobre --- DEV3.2/TP3/Luminance/Luminance.class | Bin 0 -> 1688 bytes DEV3.2/TP3/Luminance/Luminance.java | 52 + DEV3.2/TP3/Luminance/MainLuminance.class | Bin 0 -> 648 bytes DEV3.2/TP3/Luminance/MainLuminance.java | 18 + .../TP4/Arithmetique/MainArithmetique.class | Bin 0 -> 1871 bytes DEV3.2/TP4/Arithmetique/MainArithmetique.java | 31 + DEV3.4/TP2/Ex1TP2.mdj | 9534 +++++++++++++++++ DEV3.4/TP2/Ex2TP2.mdj | 2868 +++++ DEV3.4/TP2/Ex3TP2Question1 | 5 + Ex1TP2.mdj | 9534 +++++++++++++++++ 10 files changed, 22042 insertions(+) create mode 100644 DEV3.2/TP3/Luminance/Luminance.class create mode 100644 DEV3.2/TP3/Luminance/Luminance.java create mode 100644 DEV3.2/TP3/Luminance/MainLuminance.class create mode 100644 DEV3.2/TP3/Luminance/MainLuminance.java create mode 100644 DEV3.2/TP4/Arithmetique/MainArithmetique.class create mode 100644 DEV3.2/TP4/Arithmetique/MainArithmetique.java create mode 100644 DEV3.4/TP2/Ex1TP2.mdj create mode 100644 DEV3.4/TP2/Ex2TP2.mdj create mode 100644 DEV3.4/TP2/Ex3TP2Question1 create mode 100644 Ex1TP2.mdj diff --git a/DEV3.2/TP3/Luminance/Luminance.class b/DEV3.2/TP3/Luminance/Luminance.class new file mode 100644 index 0000000000000000000000000000000000000000..55b2d8cd1d9752cd8b4a1e907a92b999baf5b301 GIT binary patch literal 1688 zcmah}QCAyP5dLm9*-bVJO`xHmh|*R`QqrJRTA@}kP?|O&7%DYIZI|R0wq15{v!V3e zKhf8|c=SyV4Xt>3JjXYGfc};~pw4VsNY!&l&d%=4d^2}uzS;f#ub-a*IFDO829b;5 z1kUO>g}jCd9bx2jvb-BZ67RA39INlM_<+?(4d-*QtBIeJ?!$aZ^COXgQXDNkB|EH#S{II=;X_x^&mvGV|trKR@r8o9kA+In610mVC2*uWW7x zks4+-%n2A9ZmTH^wpG6;8v-L;(Q=Ct=F9A#9GoEKY zDAAA%TtU&mRa`SrLfOCqDh3u=e1@t(;xMLaIt_Qjz!I(-_#DdyZr}?V*THNGuI+jT zYM@~!1FLO1YxyE|wkFB3!dZv$rGc;TwLt8kT!B7@Z|9r$Eeg20Xgbms7(U3{H8(C= zI?QS3h;C9|78A6{Kq9^FNz*4*Q|ZkAuqY6`e9At@-Lqjk-S! z37VTGd{feHP@^=@E@nG!UW(|N^lw-Ve?3T8q=aO+BCWM`Dkpl!vhAv@)1#Iy(vKrF zM{fHxCECe!F+&mBmT9+S?2$5bXuCN26^g<3oV2Cd8GLh8inRbih2x(b_0-v7U zg~)~Pjt3xy=V?LCMgPWQJcV-P2PAWM{h=`(F8y=uBh5FJqrH$_)S<5LZAMq4@A^eK|Hjd}Q|FJ~=ZP`VNn;%k#G@8Od(8erJH55#B zfj)eo?_LCbG}q(wA0S>%AVW+|5K~jcQ-LgHV(BL7w}~rBT)7mzLk#?hQ89>@J9K#4kGT5W|dsP7|F4tVOfHu YkA~$4mN^ paralleloliste = new ArrayList<>(); + int color; + if (this.isOpaque()) { + // obligatoire : on repeint toute la surface avec la couleur de fond + pinceau2.setColor(Color.DARK_GRAY); + pinceau2.fillRect(0, 0, this.getWidth(), this.getHeight()); + } if(listenoncréer){ + for (int i=0; i<30; i++){ + Random rand = new Random(); + color = rand.nextInt(256); + paralleloliste.add(i,color); + } listenoncréer = false; + } for (int i=0; i<10; i++){ + int x[] = {0+(this.getWidth()/11)*i,80+(this.getWidth()/11)*i,180+(this.getWidth()/11)*i,100+(this.getWidth()/11)*i}; + int y[] = {this.getHeight()-10,10,10,this.getHeight()-10}; + pinceau2.setColor(new Color(paralleloliste.get(0+3*i),paralleloliste.get(1+3*i),paralleloliste.get(2+3*i))); + pinceau2.fillPolygon(x,y,4); + } + } + + public void mouseClicked(MouseEvent e){ + } + + public void mouseEntered(MouseEvent e){ + } + + public void mouseExited(MouseEvent e){ + } + + public void mousePressed(MouseEvent e){ + } + + public void mouseReleased(MouseEvent e){ + } +} \ No newline at end of file diff --git a/DEV3.2/TP3/Luminance/MainLuminance.class b/DEV3.2/TP3/Luminance/MainLuminance.class new file mode 100644 index 0000000000000000000000000000000000000000..f37adfb5671dcc90cc1841fab79b8e3a4beb22b7 GIT binary patch literal 648 zcmY*W(N5Gr6g{);wrsb+F6x3P3M$y$68fUyLBq=$5=>W2)@-6a&F+q5$aZSlDHy*B zUP=OqAK)kXV7RkOMB4P+J9o~UIrsMW-^*VBcCqbY9xWHk9x5iTc(Bnji-!hQ4LmaN z*ua{BCoZ14SZ8qFN+tCkgB7#~40bmi3x>s5D)FI6h9djKhZCyU373kY6?~14`3a9E zTpdMyok?}{#vJteX_1Y@zBJ^e9+BfBk&3I4*f9ruEMSp#O#UOvPw8Crem~<0(QE&x zJ~r^o$8!TOu<2t9FMR}P`{*EKn7<>;(75$-I6M|3&EV!j_vKHLtp*1N##)^!aXR8! zrqn@$kH@{V$VDu3EtJR@HiB7C{8UHcL?|8IAx!&QA(40D8!slhJ4thK_+4Z-igqx) zW`P*pRFS6s$Q9kc{GY7ZpqYqlHY}nJWG-iu4ZgGo)VEJR(L5C}Gb_Rdt=1?qiq*~q z*f}K(O+sf{bWp<*?on>22`qYn*H@@~zJL{9!KPU4g-!dci9aQr(6UOn;dY6+&?!+f qnHSn6>bKHcBntZG;E`+{tK@8*yls-J4*80x`ie|2+$UZI53T{u@P|hL literal 0 HcmV?d00001 diff --git a/DEV3.2/TP3/Luminance/MainLuminance.java b/DEV3.2/TP3/Luminance/MainLuminance.java new file mode 100644 index 0000000..1d910ed --- /dev/null +++ b/DEV3.2/TP3/Luminance/MainLuminance.java @@ -0,0 +1,18 @@ +import java.awt.*; +import javax.swing.*; +import java.awt.event.*; +import java.util.*; + +public class MainLuminance{ + public static void main(String[] args) { + + JFrame fenetre = new JFrame(); + Luminance pan = new Luminance(); + fenetre.setSize(1200, 250); + fenetre.setLocation(0, 0); + fenetre.addMouseListener(pan); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + fenetre.setContentPane(pan); + fenetre.setVisible(true); + } +} \ No newline at end of file diff --git a/DEV3.2/TP4/Arithmetique/MainArithmetique.class b/DEV3.2/TP4/Arithmetique/MainArithmetique.class new file mode 100644 index 0000000000000000000000000000000000000000..037cc3ee2668d75352995155e5b69864abd45662 GIT binary patch literal 1871 zcma)7&vV;E6#h20BU_b|)cMi0jg13oacrlCQlQkSOX@bn5H|sblu}^WI7_TXmW;H@ zG{cSIz@GqDICOwZ;gDw9nG9$6S2%FxK;fvrEI`WuP`xi76)Xqz4csYiPcqO4s>9~wH zG+fb8WEh+`ZBv#QLYdihhH%;06b!@5rY&yy%?;tM@ePYsPSm+o_bo1k?=sA1mhbT$ zUa+{mRj5hVw6}`w6rjSHFL}6(s#+x>i;!8 z-*35eyt{Cdn>NEl=5GHHm9$=Se77zZO_k_)mB0(GDH}~8O-kW{%GAI(CJfBuDg(R+2e6MlD&S7k{-A(kaCqQ#-C~LINPFgi`r2w^15`~T@4>mot7PE+owtx726hW+2WojDAaGdL+#jT_sJ5s zH!b1Kv=4UfW&ceLR(cMu?Y6`*@a|i4Sc5K3Iws28vTCLjMGYS_oa@W)xY!s{|Bb^m zz0t<#r3HjQtYU)3Q=}znW;92#kHCJW2Zl)+2ZO~Bz5M9jVL(AyjgE$C9?n(=O8Gqu z{6s+daS~cbjwDYqM{GDZ Qd_YGpksc-eRg%~K1)=rF@Bjb+ literal 0 HcmV?d00001 diff --git a/DEV3.2/TP4/Arithmetique/MainArithmetique.java b/DEV3.2/TP4/Arithmetique/MainArithmetique.java new file mode 100644 index 0000000..f72580f --- /dev/null +++ b/DEV3.2/TP4/Arithmetique/MainArithmetique.java @@ -0,0 +1,31 @@ +import java.util.*; + +public class MainArithmetique { + + public static String calculateur(String val, ArrayDeque pile){ + switch(val){ + case "+": + return String.valueOf(Integer.parseInt(calculateur(pile.pop(), pile))+Integer.parseInt(calculateur(pile.pop(), pile))); + case "-": + return String.valueOf(-(Integer.parseInt(calculateur(pile.pop(), pile)))+Integer.parseInt(calculateur(pile.pop(), pile))); + case "x": + return String.valueOf(Integer.parseInt(calculateur(pile.pop(), pile))*Integer.parseInt(calculateur(pile.pop(), pile))); + case "/": + return String.valueOf(Integer.parseInt(calculateur(pile.pop(), pile))/Integer.parseInt(calculateur(pile.pop(), pile))); + default: + return val; + } + } + + public static void main(String[] args) { + ArrayDeque pile = new ArrayDeque(args.length); + String result; + + for (int i=0; i