diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..b34ff9fb7ab7bac80218603e75eb3e94dcaa52b3 Binary files /dev/null and b/.DS_Store differ diff --git a/entrainement/.DS_Store b/entrainement/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..b3e13f3533289810ce1d2142bad9a5e92bfd33a0 Binary files /dev/null and b/entrainement/.DS_Store differ diff --git a/entrainement/Conditions.class b/entrainement/Conditions.class new file mode 100644 index 0000000000000000000000000000000000000000..f3e803eed6a87ef2cd1616b797cd9e8ec5a0454f Binary files /dev/null and b/entrainement/Conditions.class differ diff --git a/entrainement/Conditions.java b/entrainement/Conditions.java new file mode 100644 index 0000000000000000000000000000000000000000..a5a4d3037bf63a2f5ccb1f827972562f6468625e --- /dev/null +++ b/entrainement/Conditions.java @@ -0,0 +1,10 @@ +class Conditions{ + public static void main (String[] args){ + int argent = 5500; + if(argent >= 5000){ + System.out.println("Test"); + }else { + System.out.println("Non"); + } + } +} \ No newline at end of file diff --git a/entrainement/Variables.class b/entrainement/Variables.class new file mode 100644 index 0000000000000000000000000000000000000000..0f4615cb073491e3662c7d6501a7ea41f8f50c31 Binary files /dev/null and b/entrainement/Variables.class differ diff --git a/entrainement/Variables.java b/entrainement/Variables.java new file mode 100644 index 0000000000000000000000000000000000000000..9f59e8a350fc9f593e736939eaf653c9a4e9fbeb --- /dev/null +++ b/entrainement/Variables.java @@ -0,0 +1,9 @@ +class Variables{ + public static void main(String[] args){ + int age = 65; + String pseudo = "Test"; + System.out.println(age + ":" + pseudo); + age= age + 1; + System.out.println(age + ":" + pseudo); + } +} \ No newline at end of file diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..87b464cb16562fd4b806a61e9868f20bf33030c3 Binary files /dev/null and b/src/.DS_Store differ diff --git a/src/tp01/Book.class b/src/tp01/Book.class new file mode 100644 index 0000000000000000000000000000000000000000..80fbb9d27e05b011bacc2baf66c15850f4cb4c33 Binary files /dev/null and b/src/tp01/Book.class differ diff --git a/src/tp01/Book.java b/src/tp01/Book.java new file mode 100644 index 0000000000000000000000000000000000000000..2ab66aed57f8be94186b42a22f7b3f95f9c7e2e1 --- /dev/null +++ b/src/tp01/Book.java @@ -0,0 +1,14 @@ +class Book { + int year; + String title; + String author; + + Book(String a,String b,int c){ + this.author=a; + this.title=b; + this.year=c; + } + public String toString(){ + return this.author + ":" + this.title + ":" + this.year; + } +} \ No newline at end of file diff --git a/src/tp01/HighScore.class b/src/tp01/HighScore.class new file mode 100644 index 0000000000000000000000000000000000000000..775f379e2acf2dae2a06f0ad07b362ce03cf601a Binary files /dev/null and b/src/tp01/HighScore.class differ diff --git a/src/tp01/HighScore.java b/src/tp01/HighScore.java new file mode 100644 index 0000000000000000000000000000000000000000..441c50696849b22ea73f97b9895b4870dfe44a29 --- /dev/null +++ b/src/tp01/HighScore.java @@ -0,0 +1,13 @@ +class HighScore{ + Score[] top; + HighScore(){ + this.top=new Score[100]; + } + HighScore(int taillejeu){ + int taille=100; + this.top=new Score[taille]; + } + int getNbfreeSlot(){ + + } +} \ No newline at end of file diff --git a/src/tp01/Score.class b/src/tp01/Score.class new file mode 100644 index 0000000000000000000000000000000000000000..fb18f8e030e44345b45b9a7e8f0abd3edde7cbd2 Binary files /dev/null and b/src/tp01/Score.class differ diff --git a/src/tp01/Score.java b/src/tp01/Score.java new file mode 100644 index 0000000000000000000000000000000000000000..4077afa1b2225149516f20e0c69695c3be686d93 --- /dev/null +++ b/src/tp01/Score.java @@ -0,0 +1,14 @@ +class Score{ + int score; + String name; + String timestamp; + + Score(String a,int b, String c){ + this.timestamp=a; + this.name=c; + this.score=b; + } + public String toString(){ + return this.timestamp + ":" + this.name + "=" + this.score; + } +} \ No newline at end of file diff --git a/src/tp01/UseBook.class b/src/tp01/UseBook.class new file mode 100644 index 0000000000000000000000000000000000000000..55271a52d66559a480177ef6271fb7e74dfc7aee Binary files /dev/null and b/src/tp01/UseBook.class differ diff --git a/src/tp01/UseBook.java b/src/tp01/UseBook.java new file mode 100644 index 0000000000000000000000000000000000000000..627f6b8fdd2580d82488c0f7f7bbfc3404055752 --- /dev/null +++ b/src/tp01/UseBook.java @@ -0,0 +1,5 @@ +class UseBook { + public static void main(String[] args){ + System.out.println(); + } +} \ No newline at end of file diff --git a/src/tp01/UseBook2.class b/src/tp01/UseBook2.class new file mode 100644 index 0000000000000000000000000000000000000000..9214e3fd2f62fdcdf979e77f71c521b57e1840d0 Binary files /dev/null and b/src/tp01/UseBook2.class differ diff --git a/src/tp01/UseBook2.java b/src/tp01/UseBook2.java new file mode 100644 index 0000000000000000000000000000000000000000..e0d2376535f4ad9cc76e2919ad67ea6ecf9fc348 --- /dev/null +++ b/src/tp01/UseBook2.java @@ -0,0 +1,18 @@ +class UseBook2{ + public static void main(String[] args){ + Book[] livre= new Book[]{ + new Book("Auteur1", "Titre1", 1789), + new Book("Auteur2", "Titre2", 1815), + new Book("Auteur3", "Titre3", 1914), + new Book("Auteur4", "Titre4", 1918), + new Book("Auteur5", "Titre5", 2015), + }; + Book min=livre[0]; + for(int i=0;i<livre.length;i++){ + System.out.println(livre[i]); + } + for(int j=0;j>livre.length;j++){ + System.out.println(min[j]); + } +} +} \ No newline at end of file diff --git a/src/tp02/Competitor.class b/src/tp02/Competitor.class new file mode 100644 index 0000000000000000000000000000000000000000..c39a5b2791892d3377ad35946c45e8dd80c9e725 Binary files /dev/null and b/src/tp02/Competitor.class differ diff --git a/src/tp02/Competitor.java b/src/tp02/Competitor.java new file mode 100644 index 0000000000000000000000000000000000000000..206adbcf9b58d5c488af7a974f24115e12987349 --- /dev/null +++ b/src/tp02/Competitor.java @@ -0,0 +1,46 @@ +class Competitor{ + private int score; + private int time; + private String numberSign; + + public Competitor(int numberSign, int score, int min, int sec){ + if(!verifierdossard(numberSign, score, min, sec)){ + this.numberSign="invalide"; + } + else{this.numberSign ="No"+ numberSign; + } + this.score = score; + this.time = 60*min + sec; + + } + public String toString(){ + return "(" + this.numberSign + ", " + this.score + " points, " + this.time + "s)"; + } + public static boolean verifierdossard(int numberSign, int score, int min, int sec){ + if(numberSign <1 || numberSign >100){ + return false; + } else if(score <0 || score >50){ + + return false; + } else if (min <0 || min >59){ + return false; + } else if (sec <0 || sec >59){ + return false; + }return true; + } + + public boolean equals(Competitor other){ + if(this==other){ + return true; + }else if(other==null){ + return false; + }else if(this.numberSign.equals (other.numberSign) && this.score==other.score){ + return true; + } return false; + } + public boolean isFaster(Competitor other){ + if(this.time > other.time){ + return false; + } return true; + } +} \ No newline at end of file diff --git a/src/tp02/Dice.java b/src/tp02/Dice.java new file mode 100644 index 0000000000000000000000000000000000000000..600c9caef010a1fbd7cf45a95f357c29a98f9254 --- /dev/null +++ b/src/tp02/Dice.java @@ -0,0 +1,6 @@ +class Dice{ + private int numberSides; + private Random rand; + private int value; + +} \ No newline at end of file diff --git a/src/tp02/UseCompetitor.class b/src/tp02/UseCompetitor.class new file mode 100644 index 0000000000000000000000000000000000000000..3a3f7b6bca9bd8ac481a252def96f6877c6328c7 Binary files /dev/null and b/src/tp02/UseCompetitor.class differ diff --git a/src/tp02/UseCompetitor.java b/src/tp02/UseCompetitor.java new file mode 100644 index 0000000000000000000000000000000000000000..80145ef95abf468aa8909a68405c326d2117bb07 --- /dev/null +++ b/src/tp02/UseCompetitor.java @@ -0,0 +1,29 @@ +class UseCompetitor{ + + public static void main(String [] args){ + Competitor [] competitor= new Competitor[100]; + competitor[0]= new Competitor (1,45,15,20); + competitor[1]= new Competitor (2,32,12,45); + competitor[2]= new Competitor (5,12,13,59); + competitor[3]= new Competitor (12,12,15,70); + competitor[4]= new Competitor (32,75,15,20); + competitor[5]= new Competitor (32,75,15,10); + competitor[6]= new Competitor (2,32,12,45); + competitor[7]= new Competitor (12,12,15,70); + for(int c=0; c<competitor.length; c++){ + System.out.println(competitor[c]); + } + if(!competitor[5].equals(competitor[2])){ + System.out.println("Test de bz "); + } + if(!competitor[6].equals(competitor[1])){ + System.out.println("Test Pas Bien"); + } + if(competitor[7].equals(competitor[3])){ + System.out.println("Nan Wallah Pardon"); + } + + + + } +} \ No newline at end of file diff --git a/src/tp02/UseCompetitor2.class b/src/tp02/UseCompetitor2.class new file mode 100644 index 0000000000000000000000000000000000000000..9ea1c2d9ba45a683b2a3ee106f6ab6b178b5bb14 Binary files /dev/null and b/src/tp02/UseCompetitor2.class differ diff --git a/src/tp02/UseCompetitor2.java b/src/tp02/UseCompetitor2.java new file mode 100644 index 0000000000000000000000000000000000000000..e6f286003ae1ba1d8cefa0097467871c1af86107 --- /dev/null +++ b/src/tp02/UseCompetitor2.java @@ -0,0 +1,13 @@ +class UseCompetitor2 { + public static void main(String[] args) { + Competitor alice = new Competitor(1, 45, 15, 20); + Competitor bruno = new Competitor(1, 45, 15, 20); + Competitor clement = new Competitor(2, 32, 12, 45); + Competitor dora = new Competitor(2, 34, 12, 45); + System.out.println("Alice:" + alice + " Bruno:" + bruno + "->" + alice.equals(bruno)); + System.out.println("Alice:" + alice + " null:" + null + "->" + alice.equals(null)); + System.out.println("Alice:" + alice + " Alice:" + alice + "->" + alice.equals(alice)); + System.out.println("Alice:" + alice + " Clement:" + clement + "->" + alice.equals(clement)); + System.out.println("Clement:" + clement + " Dora:" + dora + "->" + clement.equals(dora)); + } +}