A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
graphlib_java.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cosmetics.
[graphlib_java.git]
/
Exemple3.java
diff --git
a/Exemple3.java
b/Exemple3.java
index
2b488d1
..
78ccb9e
100644
(file)
--- a/
Exemple3.java
+++ b/
Exemple3.java
@@
-1,14
+1,16
@@
import java.util.*;
import java.util.*;
-
public
class Exemple3 {
+class Exemple3 {
static final Random random = new Random();
public static void main(String[] args) {
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);
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);
int x1 = random.nextInt(w.width);
int y1 = random.nextInt(w.height);
int x2 = random.nextInt(w.width);