From 7683a5c58f1e57ae9e8ef3591052b1fd21b4135d Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Sat, 19 Sep 2020 03:51:59 +0200 Subject: [PATCH] Improved code. --- src/fr/devinsy/catgenerator/core/CatGenerator.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/fr/devinsy/catgenerator/core/CatGenerator.java b/src/fr/devinsy/catgenerator/core/CatGenerator.java index 2cef020..767cf6b 100644 --- a/src/fr/devinsy/catgenerator/core/CatGenerator.java +++ b/src/fr/devinsy/catgenerator/core/CatGenerator.java @@ -100,9 +100,6 @@ public class CatGenerator } else { - // Initialize the random generator. - Random generator = new Random(Integer.parseInt(DigestUtils.md5Hex(seed).substring(0, 6), 16)); - // Create an empty image. result = new BufferedImage(256, 256, BufferedImage.TYPE_INT_ARGB); Graphics2D grapher = result.createGraphics(); @@ -110,6 +107,8 @@ public class CatGenerator grapher.clearRect(0, 0, 256, 256); // Add stuff. + // Initialize the random generator. + Random generator = new Random(Integer.parseInt(DigestUtils.md5Hex(seed).substring(0, 6), 16)); drawImage(grapher, "body", generator.nextInt(15) + 1); drawImage(grapher, "fur", generator.nextInt(10) + 1); drawImage(grapher, "eyes", generator.nextInt(15) + 1);