Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove empty color name.
[graphlib_java.git] / Exemple3.java
index bcafae5..78ccb9e 100644 (file)
@@ -1,14 +1,16 @@
 import java.util.*;
 
-public class Exemple3 {
+class Exemple3 {
 
     static final Random random = new Random();
 
     public static void main(String[] args) {
+        // Création de la fenêtre
         DrawingWindow w = new DrawingWindow("Exemple 3", 640, 480);
 
-        for (int i = 0; ; i++) {
-
+        // Sans s'arrêter, affiche des lignes au hasard avec une
+        // couleur tirée aléatoirement
+        while (true) {
             int x1 = random.nextInt(w.width);
             int y1 = random.nextInt(w.height);
             int x2 = random.nextInt(w.width);
@@ -21,4 +23,3 @@ public class Exemple3 {
         }
     }
 }
-