diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9d4257b2b0193aba4924241543cc89ede0f2e589..73a4a53561e809013a4d2194de140f930d46c2a5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,6 @@ stages: - test + - pages test: image: openjdk:11 @@ -10,3 +11,14 @@ test: reports: junit: - build/test-results/test/*.xml + +pages: + image: openjdk:11 + stage: pages + script: + - ./gradlew javadoc + - rm -rf public || true + - mv build/docs/javadoc public + artifacts: + paths: + - public diff --git a/src/main/java/fr/unistra/mathinfo/gl/tp/demo/FizzBuzz.java b/src/main/java/fr/unistra/mathinfo/gl/tp/demo/FizzBuzz.java index 71fccf958385894353a7d781d659eb728784c379..bf739e67e20f3a1b4b77df1cdb7fac1150b85012 100644 --- a/src/main/java/fr/unistra/mathinfo/gl/tp/demo/FizzBuzz.java +++ b/src/main/java/fr/unistra/mathinfo/gl/tp/demo/FizzBuzz.java @@ -1,7 +1,16 @@ package fr.unistra.mathinfo.gl.tp.demo; +/** + * FizzBuzz + * @see <a href="https://en.wikipedia.org/wiki/Fizz_buzz">FizzBuzz on wikipedia [en]</a> + */ public interface FizzBuzz { + /** + * @param nombre le numero du joueur + * @return la réponse de FizzBuzz (nombre, Fizz, Buzz ou FizzBuzz) + * @throws IllegalArgumentException si nombre ≤0 ou > 100 + **/ public String convert(int nombre); } diff --git a/src/main/java/fr/unistra/mathinfo/gl/tp/demo/package-info.java b/src/main/java/fr/unistra/mathinfo/gl/tp/demo/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..adf7c242b8c430c7cdf6e9113918b0889d7a2297 --- /dev/null +++ b/src/main/java/fr/unistra/mathinfo/gl/tp/demo/package-info.java @@ -0,0 +1,22 @@ +/** + * <strong>Fizz buzz</strong> + * <small>From Wikipedia, the free encyclopedia</small> + * <p>Fizz buzz is a group word game for children to teach them about division. + * Players take turns to count incrementally, replacing any number divisible + * by three with the word "fizz", and any number divisible by five with the word "buzz". + * </p> + * <p>Players generally sit in a circle. + * The player designated to go first says the number "1", + * and the players then count upwards in turn. + * However, any number divisible by three is replaced by the word fizz + * and any number divisible by five by the word buzz. + * Numbers divisible by 15 become fizz buzz. + * A player who hesitates or makes a mistake is eliminated from the game. + * </p> + * <p>For example, a typical round of fizz buzz would start as follows: + * 1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, Fizz Buzz, + * 16, 17, Fizz, 19, Buzz, Fizz, 22, 23, Fizz, Buzz, 26, Fizz, 28, 29, + * Fizz Buzz, 31, 32, Fizz, 34, Buzz, Fizz, ... + * </p> + */ +package fr.unistra.mathinfo.gl.tp.demo;