From 3b7c6ec75144a2fae32b2eb3544213dd52745744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Ram=C3=B3n=20=28JR=29?= Date: Sat, 28 Dec 2024 18:19:09 +0100 Subject: [PATCH] Write constants in UPPER_CASE --- exercises/practice/darts/.approaches/introduction.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/exercises/practice/darts/.approaches/introduction.md b/exercises/practice/darts/.approaches/introduction.md index b68d0ada6..8aa7f2591 100644 --- a/exercises/practice/darts/.approaches/introduction.md +++ b/exercises/practice/darts/.approaches/introduction.md @@ -39,19 +39,19 @@ import java.util.function.DoublePredicate; class Darts { - final private static double innerRing = 1.0; - final private static double middleRing = 5.0; - final private static double outerRing = 10.0; + private static final double INNER_RING = 1.0; + private static final double MIDDLE_RING = 5.0; + private static final double OUTER_RING = 10.0; int score(double x, double y) { var pointRadius = (Math.sqrt((x * x) + (y * y))); DoublePredicate thrownOutside = ring -> pointRadius > ring; - if (thrownOutside.test(outerRing)) + if (thrownOutside.test(OUTER_RING)) return 0; - if (thrownOutside.test(middleRing)) + if (thrownOutside.test(MIDDLE_RING)) return 1; - if (thrownOutside.test(innerRing)) + if (thrownOutside.test(INNER_RING)) return 5; return 10; }