diff --git a/DEV2.1/TP05/Gris.class b/DEV2.1/TP05/Gris.class index da103b2..21abd6d 100644 Binary files a/DEV2.1/TP05/Gris.class and b/DEV2.1/TP05/Gris.class differ diff --git a/DEV2.1/TP05/Nuance.class b/DEV2.1/TP05/Nuance.class index 6aac217..81ea07c 100644 Binary files a/DEV2.1/TP05/Nuance.class and b/DEV2.1/TP05/Nuance.class differ diff --git a/DEV2.1/TP06/Cercles.class b/DEV2.1/TP06/Cercles.class index 343a790..8785707 100644 Binary files a/DEV2.1/TP06/Cercles.class and b/DEV2.1/TP06/Cercles.class differ diff --git a/DEV2.1/TP06/Sautoir.class b/DEV2.1/TP06/Sautoir.class index 4259a53..2609c60 100644 Binary files a/DEV2.1/TP06/Sautoir.class and b/DEV2.1/TP06/Sautoir.class differ diff --git a/DEV2.1/TP06/Sautoir.java b/DEV2.1/TP06/Sautoir.java index ae72164..5b60c2b 100644 --- a/DEV2.1/TP06/Sautoir.java +++ b/DEV2.1/TP06/Sautoir.java @@ -29,6 +29,7 @@ public class Sautoir extends JComponent { fenetre.setSize(250, 250); fenetre.setLocation(0, 0); fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + fenetre.setAlwaysOnTop(true); fenetre.setLayout(layout); for (int i = 0; i != 25; i++) { fenetre.add(new Sautoir()); diff --git a/DEV2.1/TP10/05_Degres/Conversion.class b/DEV2.1/TP10/05_Degres/Conversion.class new file mode 100644 index 0000000..893b649 Binary files /dev/null and b/DEV2.1/TP10/05_Degres/Conversion.class differ diff --git a/DEV2.1/TP10/05_Degres/Degres.class b/DEV2.1/TP10/05_Degres/Degres.class new file mode 100644 index 0000000..1328556 Binary files /dev/null and b/DEV2.1/TP10/05_Degres/Degres.class differ diff --git a/DEV2.1/TP10/05_Degres/Fenetre.class b/DEV2.1/TP10/05_Degres/Fenetre.class new file mode 100644 index 0000000..f55d798 Binary files /dev/null and b/DEV2.1/TP10/05_Degres/Fenetre.class differ diff --git a/DEV2.1/TP10/05_Degres/GestionJTextField.class b/DEV2.1/TP10/05_Degres/GestionJTextField.class new file mode 100644 index 0000000..16af3ac Binary files /dev/null and b/DEV2.1/TP10/05_Degres/GestionJTextField.class differ diff --git a/DEV2.1/TP10/05_Degres/Main.class b/DEV2.1/TP10/05_Degres/Main.class new file mode 100644 index 0000000..0476717 Binary files /dev/null and b/DEV2.1/TP10/05_Degres/Main.class differ diff --git a/DEV2.1/TP12/02_Polygone/Fenetre.java b/DEV2.1/TP12/02_Polygone/Fenetre.java index 5018045..ca46695 100644 --- a/DEV2.1/TP12/02_Polygone/Fenetre.java +++ b/DEV2.1/TP12/02_Polygone/Fenetre.java @@ -7,6 +7,7 @@ public class Fenetre extends JFrame { this.setSize(500, 600); this.setLocation(100, 100); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + this.setAlwaysOnTop(true); this.setLayout(new GridLayout(1, 1)); LectureFichier lecture = new LectureFichier(); EcritureFichier ecriture = new EcritureFichier("test", lecture.getCoordY(), lecture.getNbPoints()); diff --git a/DEV2.1/TP13/02_Image/Fenetre.class b/DEV2.1/TP13/02_Image/Fenetre.class index 753d72c..074e313 100644 Binary files a/DEV2.1/TP13/02_Image/Fenetre.class and b/DEV2.1/TP13/02_Image/Fenetre.class differ diff --git a/DEV2.1/TP13/02_Image/Image.class b/DEV2.1/TP13/02_Image/Image.class index 2672948..47d1c40 100644 Binary files a/DEV2.1/TP13/02_Image/Image.class and b/DEV2.1/TP13/02_Image/Image.class differ diff --git a/DEV2.1/TP13/02_Image/LectureFichier.class b/DEV2.1/TP13/02_Image/LectureFichier.class index 9f21ec4..5735762 100644 Binary files a/DEV2.1/TP13/02_Image/LectureFichier.class and b/DEV2.1/TP13/02_Image/LectureFichier.class differ diff --git a/DEV2.1/TP13/02_Image/Main.class b/DEV2.1/TP13/02_Image/Main.class index 4bfefb8..0476717 100644 Binary files a/DEV2.1/TP13/02_Image/Main.class and b/DEV2.1/TP13/02_Image/Main.class differ diff --git a/DEV2.1/TP14/02_Couleurs/Composant.class b/DEV2.1/TP14/02_Couleurs/Composant.class index 3b47fbf..40acdb7 100644 Binary files a/DEV2.1/TP14/02_Couleurs/Composant.class and b/DEV2.1/TP14/02_Couleurs/Composant.class differ diff --git a/DEV2.1/TP14/02_Couleurs/Fenetre.class b/DEV2.1/TP14/02_Couleurs/Fenetre.class index 2e13b48..be26add 100644 Binary files a/DEV2.1/TP14/02_Couleurs/Fenetre.class and b/DEV2.1/TP14/02_Couleurs/Fenetre.class differ diff --git a/DEV2.1/TP14/02_Couleurs/GestionMoletteSouris.class b/DEV2.1/TP14/02_Couleurs/GestionMoletteSouris.class index 92f0d87..e6211f9 100644 Binary files a/DEV2.1/TP14/02_Couleurs/GestionMoletteSouris.class and b/DEV2.1/TP14/02_Couleurs/GestionMoletteSouris.class differ diff --git a/DEV2.1/TP14/02_Couleurs/LectureFichier.class b/DEV2.1/TP14/02_Couleurs/LectureFichier.class index 16966f2..51dfdfa 100644 Binary files a/DEV2.1/TP14/02_Couleurs/LectureFichier.class and b/DEV2.1/TP14/02_Couleurs/LectureFichier.class differ diff --git a/DEV2.1/TP14/02_Couleurs/Main.class b/DEV2.1/TP14/02_Couleurs/Main.class index 4bfefb8..0476717 100644 Binary files a/DEV2.1/TP14/02_Couleurs/Main.class and b/DEV2.1/TP14/02_Couleurs/Main.class differ diff --git a/DEV2.3/TP03/git.txt b/DEV2.3/TP03/git.txt new file mode 100644 index 0000000..e69de29 diff --git a/DEV3.1/TP01/02_Victoire/Connexion.java b/DEV3.1/TP01/02_Victoire/Connexion.java index 8f55984..3984841 100644 --- a/DEV3.1/TP01/02_Victoire/Connexion.java +++ b/DEV3.1/TP01/02_Victoire/Connexion.java @@ -9,17 +9,17 @@ public class Connexion { public Connexion() { try { - Connection cnx = DriverManager.getConnection( - "jdbc:mariadb://dwarves.iut-fbleau.fr/simoes", - "simoes", "simoes" - ); - try { Class.forName("org.mariadb.jdbc.Driver"); } catch (ClassNotFoundException e2) { System.err.println("Problème de pilote."); } + Connection cnx = DriverManager.getConnection( + "jdbc:mariadb://dwarves.iut-fbleau.fr/simoes", + "simoes", "simoes" + ); + try { PreparedStatement pst = cnx.prepareStatement( "SELECT SUM(points), competiteur FROM pays GROUP BY competiteur ASC;" diff --git a/DEV3.1/TP04/02_Quiz/build/fr/iutfbleau/Quiz/AffichageQuestion.class b/DEV3.1/TP04/02_Quiz/build/fr/iutfbleau/Quiz/AffichageQuestion.class index fea64dd..e31265e 100644 Binary files a/DEV3.1/TP04/02_Quiz/build/fr/iutfbleau/Quiz/AffichageQuestion.class and b/DEV3.1/TP04/02_Quiz/build/fr/iutfbleau/Quiz/AffichageQuestion.class differ diff --git a/DEV3.1/TP04/02_Quiz/build/fr/iutfbleau/Quiz/Main.class b/DEV3.1/TP04/02_Quiz/build/fr/iutfbleau/Quiz/Main.class index f89d45d..310953b 100644 Binary files a/DEV3.1/TP04/02_Quiz/build/fr/iutfbleau/Quiz/Main.class and b/DEV3.1/TP04/02_Quiz/build/fr/iutfbleau/Quiz/Main.class differ diff --git a/DEV3.1/TP04/02_Quiz/build/fr/iutfbleau/Quiz/Question.class b/DEV3.1/TP04/02_Quiz/build/fr/iutfbleau/Quiz/Question.class index 0aa949d..55b4dd8 100644 Binary files a/DEV3.1/TP04/02_Quiz/build/fr/iutfbleau/Quiz/Question.class and b/DEV3.1/TP04/02_Quiz/build/fr/iutfbleau/Quiz/Question.class differ diff --git a/DEV3.1/TP04/02_Quiz/build/fr/iutfbleau/Quiz/SourceQuestions.class b/DEV3.1/TP04/02_Quiz/build/fr/iutfbleau/Quiz/SourceQuestions.class index a7b395c..0f072df 100644 Binary files a/DEV3.1/TP04/02_Quiz/build/fr/iutfbleau/Quiz/SourceQuestions.class and b/DEV3.1/TP04/02_Quiz/build/fr/iutfbleau/Quiz/SourceQuestions.class differ diff --git a/DEV3.2/TP05/04_Serpent/Fenetre.class b/DEV3.2/TP05/04_Serpent/Fenetre.class index 6796bdf..ce4775e 100644 Binary files a/DEV3.2/TP05/04_Serpent/Fenetre.class and b/DEV3.2/TP05/04_Serpent/Fenetre.class differ diff --git a/DEV3.2/TP05/04_Serpent/Fenetre.java b/DEV3.2/TP05/04_Serpent/Fenetre.java index b3e004e..2d26223 100644 --- a/DEV3.2/TP05/04_Serpent/Fenetre.java +++ b/DEV3.2/TP05/04_Serpent/Fenetre.java @@ -5,17 +5,16 @@ import java.util.ArrayDeque; public class Fenetre extends JFrame { public Fenetre() { - this.setSize(500, 500); + this.setSize(460, 483); this.setLocation(100, 100); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - this.setLayout(new GridLayout(1, 1)); ArrayDeque coordSnake = new ArrayDeque<>(); for (int i = 0; i != 5; i++) { coordSnake.addLast(new Point(i+5, 5)); } JGrilleDeJeu grille = new JGrilleDeJeu(this, coordSnake); + grille.setSize(new Dimension(500, 500)); this.add(grille); - } } \ No newline at end of file diff --git a/DEV3.2/TP05/04_Serpent/JGrilleDeJeu.class b/DEV3.2/TP05/04_Serpent/JGrilleDeJeu.class index 217b4f5..2384870 100644 Binary files a/DEV3.2/TP05/04_Serpent/JGrilleDeJeu.class and b/DEV3.2/TP05/04_Serpent/JGrilleDeJeu.class differ diff --git a/DEV3.2/TP05/04_Serpent/JGrilleDeJeu.java b/DEV3.2/TP05/04_Serpent/JGrilleDeJeu.java index c4a063b..d0bfcfc 100644 --- a/DEV3.2/TP05/04_Serpent/JGrilleDeJeu.java +++ b/DEV3.2/TP05/04_Serpent/JGrilleDeJeu.java @@ -24,14 +24,13 @@ public class JGrilleDeJeu extends JComponent { this.controleur = new ControleurClavier(); this.fenetre.addKeyListener(controleur); this.directionActuelle = "Right"; - this.intervalleTimer = 150; + this.intervalleTimer = 100; Random r = new Random(); int coordXPomme = Math.abs(r.nextInt() % TAILLE_GRILLE); int coordYPomme = Math.abs(r.nextInt() % TAILLE_GRILLE); this.posPomme = new Point(coordXPomme, coordYPomme); - this.grille[coordXPomme][coordYPomme] = 'r'; this.timer = new Timer(); @@ -47,6 +46,8 @@ public class JGrilleDeJeu extends JComponent { secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight()); } + int tailleCase = this.getWidth()/TAILLE_GRILLE; + for (int i = 0; i != TAILLE_GRILLE; i++) { for (int j = 0; j != TAILLE_GRILLE; j++) { switch (grille[i][j]) { @@ -60,11 +61,12 @@ public class JGrilleDeJeu extends JComponent { secondPinceau.setColor(Color.ORANGE); } + secondPinceau.fillRect( - this.getWidth()/TAILLE_GRILLE*i+1, - this.getHeight()/TAILLE_GRILLE*j+1, - this.getWidth()/TAILLE_GRILLE-2, - this.getHeight()/TAILLE_GRILLE-2 + tailleCase*i+1, + tailleCase*j+1, + tailleCase-2, + tailleCase-2 ); } @@ -72,7 +74,29 @@ public class JGrilleDeJeu extends JComponent { } public void avancerSnake() { - this.coordSnake.removeFirst(); + + // ======== TON CODE REMPLACE ICI LA LOGIQUE DU DÉPLACEMENT ========== + boolean mangePomme = this.coordSnake.getLast().equals(this.posPomme); + if (!mangePomme) { + this.coordSnake.removeFirst(); // avance normale + } + + Point tete = this.coordSnake.getLast(); + switch (directionActuelle) { + case "Right": tete = new Point(tete.x + 1, tete.y); break; + case "Left": tete = new Point(tete.x - 1, tete.y); break; + case "Up": tete = new Point(tete.x, tete.y - 1); break; + case "Down": tete = new Point(tete.x, tete.y + 1); break; + } + this.coordSnake.addLast(tete); + + if (mangePomme) { + Random r = new Random(); + posPomme = new Point(r.nextInt(TAILLE_GRILLE), r.nextInt(TAILLE_GRILLE)); + } + // ================================================================== + + // Gestion de la direction selon les touches pressées if (!this.controleur.getTouches().isEmpty()) { String toucheAModifier = this.controleur.getTouches().removeFirst(); switch (this.directionActuelle) { @@ -97,56 +121,15 @@ public class JGrilleDeJeu extends JComponent { } break; } - - } - switch (this.directionActuelle) { - case "Right": - this.coordSnake.addLast(new Point(this.coordSnake.getLast().x+1, this.coordSnake.getLast().y)); - break; - case "Left": - this.coordSnake.addLast(new Point(this.coordSnake.getLast().x-1, this.coordSnake.getLast().y)); - break; - case "Up": - this.coordSnake.addLast(new Point(this.coordSnake.getLast().x, this.coordSnake.getLast().y-1)); - break; - case "Down": - this.coordSnake.addLast(new Point(this.coordSnake.getLast().x, this.coordSnake.getLast().y+1)); - break; } + // Efface la grille for (int i = 0; i != TAILLE_GRILLE; i++) { for (int j = 0; j != TAILLE_GRILLE; j++) { this.grille[i][j] = 'g'; } } - if (this.coordSnake.getLast().equals(this.posPomme)) { - Random r = new Random(); - int coordXPomme = Math.abs(r.nextInt() % TAILLE_GRILLE); - int coordYPomme = Math.abs(r.nextInt() % TAILLE_GRILLE); - - this.posPomme = new Point(coordXPomme, coordYPomme); - - Point coordQueue = this.coordSnake.removeFirst(); - Point coordAvantQueue = this.coordSnake.getFirst(); - Point aAjouter; - - if (coordAvantQueue.equals(new Point(coordQueue.x+1, coordQueue.y))) { - aAjouter = new Point(coordQueue.x-1, coordQueue.y); - } - else if (coordAvantQueue.equals(new Point(coordQueue.x-1, coordQueue.y))) { - aAjouter = new Point(coordQueue.x+1, coordQueue.y); - } - else if (coordAvantQueue.equals(new Point(coordQueue.x, coordQueue.y+1))) { - aAjouter = new Point(coordQueue.x, coordQueue.y-1); - } - else { - aAjouter = new Point(coordQueue.x, coordQueue.y+1); - } - this.coordSnake.addFirst(aAjouter); - this.coordSnake.addFirst(coordQueue); - } - try { int compteur = this.coordSnake.size(); for (Point point : this.coordSnake) { @@ -161,7 +144,6 @@ public class JGrilleDeJeu extends JComponent { } this.grille[posPomme.x][posPomme.y] = 'r'; - this.repaint(); } -} \ No newline at end of file +} diff --git a/TD_TP1.pdf b/TD_TP1.pdf new file mode 100644 index 0000000..18294d0 Binary files /dev/null and b/TD_TP1.pdf differ diff --git a/conclusion.txt b/conclusion.txt new file mode 100644 index 0000000..f47fdd5 --- /dev/null +++ b/conclusion.txt @@ -0,0 +1,17 @@ +TD/TP 2 : Duel d'Interfaces (CLI vs. GUI) + +Chronomètre explorateur de fichiers (GUI) : 1m 19s +Chronomètre terminal (CLI) : 16s (avec rename) + +Lorsque l'utilisateur est suffisament expérimenté, il sera toujours plus rapide et efficace avec la CLI qu'avec +la GUI. Pour un utilisateur lambda, il reste plus rapide de renommer chaque fichier individuellement plutôt que +de prendre le temps d'essayer de comprendre une commande. Si on cherche à être optimal, la CLI reste imbattable car on +peut réaliser l'entièreté de l'opération avec une seule commande, tandis que la GUI nécessite d'alterner plusieurs fois +entre souris et clavier pour renommer chaque fichier un par un. Cette solution reste abordable dans le cas présent (avec +15 fichiers), mais elle deviendrait ingérable avec une quantité de données conséquente (avec 1000 fichiers par exemple), +où l'utilisation du terminal deviendrait presque indispensable. + +Commandes utilisées : + +rename .jpg .png *.jpg +rename .txt .md *.txt diff --git a/simoes_lukas_but2_tp1_tp2_ihm b/simoes_lukas_but2_tp1_tp2_ihm new file mode 100644 index 0000000..a2ea575 Binary files /dev/null and b/simoes_lukas_but2_tp1_tp2_ihm differ diff --git a/tp2_cli_vs_gli/photo-04.png b/tp2_cli_vs_gli/photo-04.png new file mode 100644 index 0000000..e69de29 diff --git a/tp2_cli_vs_gli/photo-05.png b/tp2_cli_vs_gli/photo-05.png new file mode 100644 index 0000000..e69de29 diff --git a/tp2_cli_vs_gli/photo-06.png b/tp2_cli_vs_gli/photo-06.png new file mode 100644 index 0000000..e69de29 diff --git a/tp2_cli_vs_gli/photo-07.png b/tp2_cli_vs_gli/photo-07.png new file mode 100644 index 0000000..e69de29 diff --git a/tp2_cli_vs_gli/rapport_v1.md b/tp2_cli_vs_gli/rapport_v1.md new file mode 100644 index 0000000..e69de29 diff --git a/tp2_cli_vs_gli/rapport_v2.md b/tp2_cli_vs_gli/rapport_v2.md new file mode 100644 index 0000000..e69de29 diff --git a/tp2_cli_vs_gli/rapport_v3.md b/tp2_cli_vs_gli/rapport_v3.md new file mode 100644 index 0000000..e69de29 diff --git a/tp2_cli_vs_gli/rapport_v4.md b/tp2_cli_vs_gli/rapport_v4.md new file mode 100644 index 0000000..e69de29 diff --git a/tp2_cli_vs_gli/rapport_v5.md b/tp2_cli_vs_gli/rapport_v5.md new file mode 100644 index 0000000..e69de29 diff --git a/tp2_cli_vs_gli/rapport_v6.md b/tp2_cli_vs_gli/rapport_v6.md new file mode 100644 index 0000000..e69de29 diff --git a/tp2_cli_vs_gli/rapport_v7.md b/tp2_cli_vs_gli/rapport_v7.md new file mode 100644 index 0000000..e69de29 diff --git a/tp2_cli_vs_gli/rapport_v8.md b/tp2_cli_vs_gli/rapport_v8.md new file mode 100644 index 0000000..e69de29 diff --git a/tp2_cli_vs_gli/simoes_lukas_tp1_tp2_ihm b/tp2_cli_vs_gli/simoes_lukas_tp1_tp2_ihm new file mode 100644 index 0000000..b7ebf94 Binary files /dev/null and b/tp2_cli_vs_gli/simoes_lukas_tp1_tp2_ihm differ