diff --git a/DEV3.2/Listes/Luminance/src/forme.java b/DEV3.2/Listes/Luminance/src/forme.java new file mode 100644 index 0000000..f7926e0 --- /dev/null +++ b/DEV3.2/Listes/Luminance/src/forme.java @@ -0,0 +1,15 @@ +import java.awt.*; + +public class forme { + public static void parallelogramme(Graphics g, int x, int y, Color c) + { + int [] xP = {x+0, x+50, x+100, x+50}; + int [] yP = {y+0, y+100, y+100, y+0}; + //Polygon p = new Polygon(); + g.setColor(Color.BLACK); + g.drawPolygon(xP,yP,4); + g.setColor(c); + g.fillPolygon(xP,yP,4); + } + +} diff --git a/DEV3.2/Listes/Luminance/src/main.java b/DEV3.2/Listes/Luminance/src/main.java new file mode 100644 index 0000000..0cff150 --- /dev/null +++ b/DEV3.2/Listes/Luminance/src/main.java @@ -0,0 +1,41 @@ +import java.awt.Color; +import java.awt.Graphics; +import java.util.ArrayList; +import java.util.List; +import javax.swing.*; +import java.util.Random; + +class main extends JPanel +{ + public void paintComponent(Graphics G) + { + Random rand = new Random(); + int x = 50; + int y = 50; + List couleur = new ArrayList (); + for (int i = 0; i < 10; i++) + { + couleur.add(i,new Color(rand.nextInt(255),rand.nextInt(255),rand.nextInt(255))); + } + + for (int i = 0; i < couleur.size(); i++) { + forme.parallelogramme(G, x, y, couleur.get(i)); + x+=60; + } + + //Polygon p = new Polygon(); + //g.fillPolygon(p); + } + public static void main( String args[] ) + { + JFrame frame = new JFrame(); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setBackground(Color.white); + frame.setSize(750, 250); + + main panel = new main(); + + frame.add(panel); + frame.setVisible(true); + } +} \ No newline at end of file diff --git a/DEV3.2/Listes/src/listes.java b/DEV3.2/Listes/test/src/listes.java similarity index 100% rename from DEV3.2/Listes/src/listes.java rename to DEV3.2/Listes/test/src/listes.java diff --git a/DEV3.2/Recursivité/build/appel.class b/DEV3.2/Recursivité/build/appel.class new file mode 100644 index 0000000..b6caefb Binary files /dev/null and b/DEV3.2/Recursivité/build/appel.class differ diff --git a/DEV3.2/Recursivité/src/appel.java b/DEV3.2/Recursivité/src/appel.java new file mode 100644 index 0000000..aa4437b --- /dev/null +++ b/DEV3.2/Recursivité/src/appel.java @@ -0,0 +1,20 @@ +public class appel { + + private static int factorielle(int x) + { + if( x > 1) + { + return x*factorielle(x-1); + } + else + { + return 1; + } + } + + public static void main(String[] args) { + + int y = factorielle(Integer.parseInt(args[0])); + System.out.println(y); + } +}