From 415448516b97d9032988cc7ec6cdcb526ae81dac Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 16:14:37 +0200 Subject: [PATCH 01/49] Add exercise stub for 'all-your-base' exercise --- .../src/main/java/BaseConverter.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/exercises/practice/all-your-base/src/main/java/BaseConverter.java b/exercises/practice/all-your-base/src/main/java/BaseConverter.java index 6178f1beb..832d1dfdc 100644 --- a/exercises/practice/all-your-base/src/main/java/BaseConverter.java +++ b/exercises/practice/all-your-base/src/main/java/BaseConverter.java @@ -1,10 +1,11 @@ -/* +class BaseConverter { -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. + BaseConverter(final int originalBase, final int[] originalDigits) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -Please remove this comment when submitting your solution. + int[] convertToBase(final int newBase) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ +} \ No newline at end of file From 3928d7ee2cfe2fe58d0aebd2b86d9f8e1f9f126d Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 16:21:20 +0200 Subject: [PATCH 02/49] Add exercise stub for 'alphametics' exercise --- .../alphametics/src/main/java/Alphametics.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/exercises/practice/alphametics/src/main/java/Alphametics.java b/exercises/practice/alphametics/src/main/java/Alphametics.java index 6178f1beb..d9e34053c 100644 --- a/exercises/practice/alphametics/src/main/java/Alphametics.java +++ b/exercises/practice/alphametics/src/main/java/Alphametics.java @@ -1,10 +1,13 @@ -/* +import java.util.Map; -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. +class Alphametics { -Please remove this comment when submitting your solution. + Alphametics(final String userInput) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ + Map solve() throws UnsolvablePuzzleException { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + +} \ No newline at end of file From 4109a023edfb599421c0231671b8a50d79ceeb2c Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 16:26:18 +0200 Subject: [PATCH 03/49] Add exercise stub for 'anagram' exercise --- .../practice/anagram/src/main/java/Anagram.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/exercises/practice/anagram/src/main/java/Anagram.java b/exercises/practice/anagram/src/main/java/Anagram.java index 6178f1beb..7c3b98284 100644 --- a/exercises/practice/anagram/src/main/java/Anagram.java +++ b/exercises/practice/anagram/src/main/java/Anagram.java @@ -1,10 +1,13 @@ -/* +import java.util.List; -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. +class Anagram { -Please remove this comment when submitting your solution. + Anagram(final String word) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ + List match(final List candidates) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + +} \ No newline at end of file From 0a1b12713d47595f0419187cdcb9cae4bd9c60e5 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 16:29:01 +0200 Subject: [PATCH 04/49] Add exercise stub for 'atbash' exercise --- .../atbash-cipher/src/main/java/Atbash.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/exercises/practice/atbash-cipher/src/main/java/Atbash.java b/exercises/practice/atbash-cipher/src/main/java/Atbash.java index 6178f1beb..9b1616499 100644 --- a/exercises/practice/atbash-cipher/src/main/java/Atbash.java +++ b/exercises/practice/atbash-cipher/src/main/java/Atbash.java @@ -1,10 +1,11 @@ -/* +class Atbash { -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. + String encode(final String input) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -Please remove this comment when submitting your solution. + String decode(final String input) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ +} From ed1a797f94a37ada112a701bb3dddf34934f5cd1 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 16:34:05 +0200 Subject: [PATCH 05/49] Add exercise stub for 'bank-account' exercise --- .../src/main/java/BankAccount.java | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/exercises/practice/bank-account/src/main/java/BankAccount.java b/exercises/practice/bank-account/src/main/java/BankAccount.java index 6178f1beb..95377a41a 100644 --- a/exercises/practice/bank-account/src/main/java/BankAccount.java +++ b/exercises/practice/bank-account/src/main/java/BankAccount.java @@ -1,10 +1,23 @@ -/* +class BankAccount { -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. + void open() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -Please remove this comment when submitting your solution. + void close() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ + synchronized int getBalance() throws BankAccountActionInvalidException { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + synchronized void deposit(final int amount) throws BankAccountActionInvalidException { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + synchronized void withdraw(final int amount) throws BankAccountActionInvalidException { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + +} \ No newline at end of file From 3ec2723c6e19b53f16167b3280884cac90bc92c0 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 16:46:49 +0200 Subject: [PATCH 06/49] Add exercise stub for 'beer-song' exercise --- .../beer-song/src/main/java/BeerSong.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/exercises/practice/beer-song/src/main/java/BeerSong.java b/exercises/practice/beer-song/src/main/java/BeerSong.java index 6178f1beb..9e9de4339 100644 --- a/exercises/practice/beer-song/src/main/java/BeerSong.java +++ b/exercises/practice/beer-song/src/main/java/BeerSong.java @@ -1,10 +1,11 @@ -/* +class BeerSong { -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. + String sing(final int startBottles, final int takeDown) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -Please remove this comment when submitting your solution. + String singSong() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ +} \ No newline at end of file From b43b6b020c458ed7a64f8eba864f95c007bda0e1 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 16:48:36 +0200 Subject: [PATCH 07/49] Add exercise stub for 'bob' exercise --- exercises/practice/bob/src/main/java/Bob.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/exercises/practice/bob/src/main/java/Bob.java b/exercises/practice/bob/src/main/java/Bob.java index 6178f1beb..680b5e5cf 100644 --- a/exercises/practice/bob/src/main/java/Bob.java +++ b/exercises/practice/bob/src/main/java/Bob.java @@ -1,10 +1,7 @@ -/* +class Bob { -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. + String hey(final String input) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -Please remove this comment when submitting your solution. - -*/ +} \ No newline at end of file From d1f10ea354faa4f42e28ae9526c6bc4f1ff092ff Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 16:50:35 +0200 Subject: [PATCH 08/49] Add exercise stub for 'book-store' exercise --- .../book-store/src/main/java/BookStore.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/exercises/practice/book-store/src/main/java/BookStore.java b/exercises/practice/book-store/src/main/java/BookStore.java index 6178f1beb..e0f9f1ddd 100644 --- a/exercises/practice/book-store/src/main/java/BookStore.java +++ b/exercises/practice/book-store/src/main/java/BookStore.java @@ -1,10 +1,9 @@ -/* +import java.util.List; -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. +class BookStore { -Please remove this comment when submitting your solution. + double calculateBasketCost(final List books) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ +} \ No newline at end of file From c7c537a782a30e1c68efc986953d6e5e2d28d5b5 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 16:53:09 +0200 Subject: [PATCH 09/49] Add exercise stub for 'bowling' exercise --- .../bowling/src/main/java/BowlingGame.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/exercises/practice/bowling/src/main/java/BowlingGame.java b/exercises/practice/bowling/src/main/java/BowlingGame.java index 6178f1beb..5823a97b1 100644 --- a/exercises/practice/bowling/src/main/java/BowlingGame.java +++ b/exercises/practice/bowling/src/main/java/BowlingGame.java @@ -1,10 +1,11 @@ -/* +class BowlingGame { -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. + void roll(final int pins) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -Please remove this comment when submitting your solution. + int score() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ +} \ No newline at end of file From a00b9c1f99938daf695e7fc07da8aecc339615ab Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 16:56:20 +0200 Subject: [PATCH 10/49] Add exercise stub for 'change' exercise --- .../change/src/main/java/ChangeCalculator.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/exercises/practice/change/src/main/java/ChangeCalculator.java b/exercises/practice/change/src/main/java/ChangeCalculator.java index 6178f1beb..2073a80fd 100644 --- a/exercises/practice/change/src/main/java/ChangeCalculator.java +++ b/exercises/practice/change/src/main/java/ChangeCalculator.java @@ -1,10 +1,13 @@ -/* +import java.util.List; -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. +class ChangeCalculator { -Please remove this comment when submitting your solution. + ChangeCalculator(final List currencyCoins) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ + List computeMostEfficientChange(final int grandTotal) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + +} From 3acf5bd1952fd8d68b879d23f45dbd5b38082354 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 17:03:09 +0200 Subject: [PATCH 11/49] Add exercise stub for 'clock' exercise --- .../src/main/java/CircularBuffer.java | 27 ++++++++++++++----- .../practice/clock/src/main/java/Clock.java | 25 ++++++++++++----- 2 files changed, 38 insertions(+), 14 deletions(-) diff --git a/exercises/practice/circular-buffer/src/main/java/CircularBuffer.java b/exercises/practice/circular-buffer/src/main/java/CircularBuffer.java index 6178f1beb..0abe27796 100644 --- a/exercises/practice/circular-buffer/src/main/java/CircularBuffer.java +++ b/exercises/practice/circular-buffer/src/main/java/CircularBuffer.java @@ -1,10 +1,23 @@ -/* +class CircularBuffer { -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. + CircularBuffer(final int size) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -Please remove this comment when submitting your solution. + T read() throws BufferIOException { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ + void write(T data) throws BufferIOException { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + void overwrite(T data) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + void clear() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + +} \ No newline at end of file diff --git a/exercises/practice/clock/src/main/java/Clock.java b/exercises/practice/clock/src/main/java/Clock.java index 6178f1beb..bcefd382a 100644 --- a/exercises/practice/clock/src/main/java/Clock.java +++ b/exercises/practice/clock/src/main/java/Clock.java @@ -1,10 +1,21 @@ -/* +class Clock { -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. + Clock(final int hours, final int minutes) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -Please remove this comment when submitting your solution. + void add(final int minutes) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ + @Override + public String toString() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + @Override + public boolean equals(Object obj) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + +} \ No newline at end of file From 490a50b263ca25d8cbbbb3818c29522388c4e38f Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 17:11:56 +0200 Subject: [PATCH 12/49] Add exercise stub for 'complex' exercise --- .../src/main/java/ComplexNumber.java | 55 ++++++++++++++++--- 1 file changed, 48 insertions(+), 7 deletions(-) diff --git a/exercises/practice/complex-numbers/src/main/java/ComplexNumber.java b/exercises/practice/complex-numbers/src/main/java/ComplexNumber.java index 6178f1beb..234dd5930 100644 --- a/exercises/practice/complex-numbers/src/main/java/ComplexNumber.java +++ b/exercises/practice/complex-numbers/src/main/java/ComplexNumber.java @@ -1,10 +1,51 @@ -/* +class ComplexNumber { -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. + ComplexNumber(final double real, final double imag) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -Please remove this comment when submitting your solution. + double getReal() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ + double getImag() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + double abs() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + ComplexNumber add(final ComplexNumber other) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + ComplexNumber minus(final ComplexNumber other) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + ComplexNumber times(final ComplexNumber other) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + ComplexNumber times(final double factor) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + ComplexNumber div(final ComplexNumber other) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + ComplexNumber div(final double divisor) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + ComplexNumber conjugate() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + ComplexNumber exponentialOf() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + +} \ No newline at end of file From e4f3d8412b12b56db72de29e560a72b2d10d374a Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 17:36:29 +0200 Subject: [PATCH 13/49] Add exercise stub for 'crypto-square' exercise --- .../crypto-square/src/main/java/CryptoSquare.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/exercises/practice/crypto-square/src/main/java/CryptoSquare.java b/exercises/practice/crypto-square/src/main/java/CryptoSquare.java index 6178f1beb..3cbbbec84 100644 --- a/exercises/practice/crypto-square/src/main/java/CryptoSquare.java +++ b/exercises/practice/crypto-square/src/main/java/CryptoSquare.java @@ -1,10 +1,11 @@ -/* +class CryptoSquare { -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. + CryptoSquare(final String plaintext) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -Please remove this comment when submitting your solution. + String getCiphertext() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ +} From 82dc7d4060db55a64b6cabf3da1168a55074fd7c Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 17:44:29 +0200 Subject: [PATCH 14/49] Add exercise stub for 'custom-set' exercise --- .../custom-set/src/main/java/CustomSet.java | 50 ++++++++++++++++--- 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/exercises/practice/custom-set/src/main/java/CustomSet.java b/exercises/practice/custom-set/src/main/java/CustomSet.java index 6178f1beb..3eab32867 100644 --- a/exercises/practice/custom-set/src/main/java/CustomSet.java +++ b/exercises/practice/custom-set/src/main/java/CustomSet.java @@ -1,10 +1,46 @@ -/* +import java.util.Collection; -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. +class CustomSet { -Please remove this comment when submitting your solution. + CustomSet() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ + CustomSet(final Collection data) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + boolean isEmpty() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + boolean contains(final T element) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + boolean isDisjoint(final CustomSet other) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + boolean add(final T element) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + @Override + public boolean equals(final Object obj) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + CustomSet getIntersection(final CustomSet other) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + CustomSet getUnion(final CustomSet other) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + CustomSet getDifference(final CustomSet other) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + +} From 76e38382839cf407fd87a4768a4ec40245473133 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 17:47:49 +0200 Subject: [PATCH 15/49] Add exercise stub for 'diffie-hellman' exercise --- .../src/main/java/DiffieHellman.java | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/exercises/practice/diffie-hellman/src/main/java/DiffieHellman.java b/exercises/practice/diffie-hellman/src/main/java/DiffieHellman.java index 6178f1beb..80fb3a258 100644 --- a/exercises/practice/diffie-hellman/src/main/java/DiffieHellman.java +++ b/exercises/practice/diffie-hellman/src/main/java/DiffieHellman.java @@ -1,10 +1,17 @@ -/* +import java.math.BigInteger; -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. +class DiffieHellman { -Please remove this comment when submitting your solution. + BigInteger privateKey(final BigInteger primeP) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ + BigInteger publicKey(final BigInteger primeP, final BigInteger primeG, final BigInteger privateKey) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + BigInteger secret(final BigInteger primeP, final BigInteger publicKey, final BigInteger privateKey) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + +} \ No newline at end of file From 0cfca42ec396353aa6f258ffc2d3a88a00032e56 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 17:51:59 +0200 Subject: [PATCH 16/49] Add exercise stub for 'dominoes' exercise --- .../practice/dominoes/src/main/java/Dominoes.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/exercises/practice/dominoes/src/main/java/Dominoes.java b/exercises/practice/dominoes/src/main/java/Dominoes.java index 6178f1beb..6889a104e 100644 --- a/exercises/practice/dominoes/src/main/java/Dominoes.java +++ b/exercises/practice/dominoes/src/main/java/Dominoes.java @@ -1,10 +1,9 @@ -/* +import java.util.List; -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. +class Dominoes { -Please remove this comment when submitting your solution. + List formChain(List inputDominoes) throws ChainNotFoundException { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ +} \ No newline at end of file From 6b282147b892ca5a39ae55f0f3f0be605cf30431 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 18:04:29 +0200 Subject: [PATCH 17/49] Add exercise stub for 'food-chain' exercise --- .../food-chain/src/main/java/FoodChain.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/exercises/practice/food-chain/src/main/java/FoodChain.java b/exercises/practice/food-chain/src/main/java/FoodChain.java index 6178f1beb..191fbc545 100644 --- a/exercises/practice/food-chain/src/main/java/FoodChain.java +++ b/exercises/practice/food-chain/src/main/java/FoodChain.java @@ -1,10 +1,11 @@ -/* +class FoodChain { -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. + String verse(final int verse) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -Please remove this comment when submitting your solution. + String verses(final int startVerse, final int endVerse) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ +} \ No newline at end of file From d30c5aa77ae6dc0af4c3fb8b0ad7f592b888e60d Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 18:04:37 +0200 Subject: [PATCH 18/49] Add exercise stub for 'flatten' exercise --- .../flatten-array/src/main/java/Flattener.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/exercises/practice/flatten-array/src/main/java/Flattener.java b/exercises/practice/flatten-array/src/main/java/Flattener.java index 6178f1beb..75c543680 100644 --- a/exercises/practice/flatten-array/src/main/java/Flattener.java +++ b/exercises/practice/flatten-array/src/main/java/Flattener.java @@ -1,10 +1,9 @@ -/* +import java.util.List; -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. +class Flattener { -Please remove this comment when submitting your solution. + List flatten(final List list) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ +} \ No newline at end of file From 3bf4ad8ba0210390e08edb582ff4e2d92f8e9f67 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 18:12:42 +0200 Subject: [PATCH 19/49] Add exercise stub for 'go-counting' exercise --- .../go-counting/src/main/java/GoCounting.java | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/exercises/practice/go-counting/src/main/java/GoCounting.java b/exercises/practice/go-counting/src/main/java/GoCounting.java index 6178f1beb..1d9d979b9 100644 --- a/exercises/practice/go-counting/src/main/java/GoCounting.java +++ b/exercises/practice/go-counting/src/main/java/GoCounting.java @@ -1,10 +1,23 @@ -/* +import java.awt.Point; +import java.util.Map; +import java.util.Set; -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. +class GoCounting { -Please remove this comment when submitting your solution. + GoCounting(String board) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ + Player getTerritoryOwner(final int x, final int y) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + Set getTerritory(final int x, final int y) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + Map> getTerritories() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + +} \ No newline at end of file From 30f36025df10a2211039503e24a6203fc97c9ebf Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 18:20:46 +0200 Subject: [PATCH 20/49] Add exercise stub for 'grade-school' exercise --- .../grade-school/src/main/java/School.java | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/exercises/practice/grade-school/src/main/java/School.java b/exercises/practice/grade-school/src/main/java/School.java index 6178f1beb..887e17edf 100644 --- a/exercises/practice/grade-school/src/main/java/School.java +++ b/exercises/practice/grade-school/src/main/java/School.java @@ -1,10 +1,17 @@ -/* +import java.util.List; -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. +class School { -Please remove this comment when submitting your solution. + void add(final String student, final int grade) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ + List roster() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + List grade(int grade) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + +} From 1961dbac383dfa5c537fa2ca5148ca849fe75160 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 18:21:03 +0200 Subject: [PATCH 21/49] Add exercise stub for 'grep' exercise --- exercises/practice/grep/src/main/java/GrepTool.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/exercises/practice/grep/src/main/java/GrepTool.java b/exercises/practice/grep/src/main/java/GrepTool.java index 6178f1beb..29e72ce27 100644 --- a/exercises/practice/grep/src/main/java/GrepTool.java +++ b/exercises/practice/grep/src/main/java/GrepTool.java @@ -1,10 +1,9 @@ -/* +import java.util.List; -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. +class GrepTool { -Please remove this comment when submitting your solution. + String grep(final String pattern, final List flags, final List files) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ +} \ No newline at end of file From 6d43c8470e7fc696c23866e76ae40d5e0bef06ef Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 19:53:09 +0200 Subject: [PATCH 22/49] Add exercise stub for 'hangman' exercise --- .../practice/hangman/src/main/java/Hangman.java | 13 ++++++------- .../practice/hangman/src/main/java/Output.java | 5 ----- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/exercises/practice/hangman/src/main/java/Hangman.java b/exercises/practice/hangman/src/main/java/Hangman.java index 6178f1beb..81f9ddb40 100644 --- a/exercises/practice/hangman/src/main/java/Hangman.java +++ b/exercises/practice/hangman/src/main/java/Hangman.java @@ -1,10 +1,9 @@ -/* +import io.reactivex.Observable; -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. +class Hangman { -Please remove this comment when submitting your solution. + Observable play(final Observable words, final Observable letters) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ +} \ No newline at end of file diff --git a/exercises/practice/hangman/src/main/java/Output.java b/exercises/practice/hangman/src/main/java/Output.java index 2d35f1353..c4376f901 100644 --- a/exercises/practice/hangman/src/main/java/Output.java +++ b/exercises/practice/hangman/src/main/java/Output.java @@ -1,11 +1,6 @@ -import static java.util.stream.Collectors.joining; - -import java.util.ArrayList; import java.util.Collections; -import java.util.HashSet; import java.util.List; import java.util.Set; -import java.util.stream.IntStream; class Output { From 0da57fdff4c2b621dd6994b56deb4c5e054f5e19 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 19:54:38 +0200 Subject: [PATCH 23/49] Add exercise stub for 'house' exercise --- .../practice/house/src/main/java/House.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/exercises/practice/house/src/main/java/House.java b/exercises/practice/house/src/main/java/House.java index 6178f1beb..34b93e159 100644 --- a/exercises/practice/house/src/main/java/House.java +++ b/exercises/practice/house/src/main/java/House.java @@ -1,10 +1,15 @@ -/* +class House { -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. + String verse(final int verse) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -Please remove this comment when submitting your solution. + String verses(final int startVerse, final int endVerse) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ + String sing() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + +} \ No newline at end of file From 820aa54b165f445adc8cdf96ea157373fcdeef25 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 20:01:26 +0200 Subject: [PATCH 24/49] Add exercise stub for 'knapsack' exercise --- .../knapsack/src/main/java/Knapsack.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/exercises/practice/knapsack/src/main/java/Knapsack.java b/exercises/practice/knapsack/src/main/java/Knapsack.java index 56c37eaf2..2f7630892 100644 --- a/exercises/practice/knapsack/src/main/java/Knapsack.java +++ b/exercises/practice/knapsack/src/main/java/Knapsack.java @@ -1,7 +1,9 @@ -/* -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. -Please remove this comment when submitting your solution. -*/ +import java.util.List; + +class Knapsack { + + int maximumValue(final int maximumWeight, List items) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + +} \ No newline at end of file From d805c21bae16ab8425d48b89eaa1e7316469e1fd Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 20:01:41 +0200 Subject: [PATCH 25/49] Add exercise stub for 'matching-brackets' exercise --- .../src/main/java/BracketChecker.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/exercises/practice/matching-brackets/src/main/java/BracketChecker.java b/exercises/practice/matching-brackets/src/main/java/BracketChecker.java index 6178f1beb..72fcaca66 100644 --- a/exercises/practice/matching-brackets/src/main/java/BracketChecker.java +++ b/exercises/practice/matching-brackets/src/main/java/BracketChecker.java @@ -1,10 +1,11 @@ -/* +class BracketChecker { -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. + BracketChecker(final String expression) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -Please remove this comment when submitting your solution. + boolean areBracketsMatchedAndNestedCorrectly() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ +} \ No newline at end of file From 8c4ed404dc6b0920d371fcfcc568374a58b0f34a Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 20:05:24 +0200 Subject: [PATCH 26/49] Add exercise stub for 'meetup' exercise --- .../practice/meetup/src/main/java/Meetup.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/exercises/practice/meetup/src/main/java/Meetup.java b/exercises/practice/meetup/src/main/java/Meetup.java index 6178f1beb..c0c31cd03 100644 --- a/exercises/practice/meetup/src/main/java/Meetup.java +++ b/exercises/practice/meetup/src/main/java/Meetup.java @@ -1,10 +1,14 @@ -/* +import java.time.DayOfWeek; +import java.time.LocalDate; -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. +class Meetup { -Please remove this comment when submitting your solution. + Meetup(final int monthOfYear, final int year) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ + LocalDate day(DayOfWeek dayOfWeek, MeetupSchedule schedule) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + +} \ No newline at end of file From 5f341c84db02403083025a4ada5e7c003f93499a Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 20:09:13 +0200 Subject: [PATCH 27/49] Add exercise stub for 'minesweeper' exercise --- .../src/main/java/MinesweeperBoard.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/exercises/practice/minesweeper/src/main/java/MinesweeperBoard.java b/exercises/practice/minesweeper/src/main/java/MinesweeperBoard.java index 6178f1beb..1011d1c08 100644 --- a/exercises/practice/minesweeper/src/main/java/MinesweeperBoard.java +++ b/exercises/practice/minesweeper/src/main/java/MinesweeperBoard.java @@ -1,10 +1,13 @@ -/* +import java.util.List; -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. +class MinesweeperBoard { -Please remove this comment when submitting your solution. + MinesweeperBoard(final List boardRows) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ + List withNumbers() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + +} \ No newline at end of file From 1c6727e8b980d4c92ac4e64af888f15249bb0894 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 20:13:18 +0200 Subject: [PATCH 28/49] Add exercise stub for 'nucleotide-count' exercise --- .../src/main/java/NucleotideCounter.java | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/exercises/practice/nucleotide-count/src/main/java/NucleotideCounter.java b/exercises/practice/nucleotide-count/src/main/java/NucleotideCounter.java index 6178f1beb..d2acb11a2 100644 --- a/exercises/practice/nucleotide-count/src/main/java/NucleotideCounter.java +++ b/exercises/practice/nucleotide-count/src/main/java/NucleotideCounter.java @@ -1,10 +1,17 @@ -/* +import java.util.Map; -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. +class NucleotideCounter { -Please remove this comment when submitting your solution. + NucleotideCounter(final String sequence) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ + int count(final char base) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + Map nucleotideCounts() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + +} \ No newline at end of file From 829601ca47cc5958c828589b15a6c5f889425de2 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 20:15:47 +0200 Subject: [PATCH 29/49] Add exercise stub for 'ocr-numbers' exercise --- .../src/main/java/OpticalCharacterReader.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/exercises/practice/ocr-numbers/src/main/java/OpticalCharacterReader.java b/exercises/practice/ocr-numbers/src/main/java/OpticalCharacterReader.java index 6178f1beb..f4a07841f 100644 --- a/exercises/practice/ocr-numbers/src/main/java/OpticalCharacterReader.java +++ b/exercises/practice/ocr-numbers/src/main/java/OpticalCharacterReader.java @@ -1,10 +1,9 @@ -/* +import java.util.List; -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. +class OpticalCharacterReader { -Please remove this comment when submitting your solution. + String parse(final List input) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ +} \ No newline at end of file From 8d9c86a5ed1e5cc5d4005ff00624b7381f36d5cd Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 20:28:28 +0200 Subject: [PATCH 30/49] Add exercise stub for 'palindrome-products' exercise --- .../src/main/java/PalindromeCalculator.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/exercises/practice/palindrome-products/src/main/java/PalindromeCalculator.java b/exercises/practice/palindrome-products/src/main/java/PalindromeCalculator.java index 6178f1beb..e9d0575ac 100644 --- a/exercises/practice/palindrome-products/src/main/java/PalindromeCalculator.java +++ b/exercises/practice/palindrome-products/src/main/java/PalindromeCalculator.java @@ -1,10 +1,10 @@ -/* +import java.util.List; +import java.util.SortedMap; -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. +class PalindromeCalculator { -Please remove this comment when submitting your solution. + SortedMap>> getPalindromeProductsWithFactors(final int minFactor, final int maxFactor) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ +} \ No newline at end of file From 2b6987cc51a86dff1e75e12e1b8d7730076e8d02 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 20:28:32 +0200 Subject: [PATCH 31/49] Add exercise stub for 'parallel-letter-frequency' exercise --- .../src/main/java/ParallelLetterFrequency.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/exercises/practice/parallel-letter-frequency/src/main/java/ParallelLetterFrequency.java b/exercises/practice/parallel-letter-frequency/src/main/java/ParallelLetterFrequency.java index 6178f1beb..eaff971cd 100644 --- a/exercises/practice/parallel-letter-frequency/src/main/java/ParallelLetterFrequency.java +++ b/exercises/practice/parallel-letter-frequency/src/main/java/ParallelLetterFrequency.java @@ -1,10 +1,13 @@ -/* +import java.util.Map; -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. +class ParallelLetterFrequency { -Please remove this comment when submitting your solution. + ParallelLetterFrequency(final String letters) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ + Map letterCounts() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + +} \ No newline at end of file From bb285c4a6c40a30059983c63609618828e0abd04 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 20:31:20 +0200 Subject: [PATCH 32/49] Add exercise stub for 'pascals-triangle' exercise --- .../src/main/java/PascalsTriangleGenerator.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/exercises/practice/pascals-triangle/src/main/java/PascalsTriangleGenerator.java b/exercises/practice/pascals-triangle/src/main/java/PascalsTriangleGenerator.java index 6178f1beb..8b74db8d8 100644 --- a/exercises/practice/pascals-triangle/src/main/java/PascalsTriangleGenerator.java +++ b/exercises/practice/pascals-triangle/src/main/java/PascalsTriangleGenerator.java @@ -1,10 +1,7 @@ -/* +class PascalsTriangleGenerator { -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. + int[][] generateTriangle(final int rows) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -Please remove this comment when submitting your solution. - -*/ +} \ No newline at end of file From c5548cc9f1bbd8a3ad54567edd1fbe20635b7a62 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 20:33:17 +0200 Subject: [PATCH 33/49] Add exercise stub for 'phone-number' exercise --- .../phone-number/src/main/java/PhoneNumber.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/exercises/practice/phone-number/src/main/java/PhoneNumber.java b/exercises/practice/phone-number/src/main/java/PhoneNumber.java index 6178f1beb..b22866dc8 100644 --- a/exercises/practice/phone-number/src/main/java/PhoneNumber.java +++ b/exercises/practice/phone-number/src/main/java/PhoneNumber.java @@ -1,10 +1,11 @@ -/* +class PhoneNumber { -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. + PhoneNumber(final String numberString) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -Please remove this comment when submitting your solution. + String getNumber() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ +} \ No newline at end of file From 71254b9e6aab8219037a075629bf4b632da3df51 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 20:36:00 +0200 Subject: [PATCH 34/49] Add exercise stub for 'poker' exercise --- .../practice/poker/src/main/java/Poker.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/exercises/practice/poker/src/main/java/Poker.java b/exercises/practice/poker/src/main/java/Poker.java index 6178f1beb..4f2b1b161 100644 --- a/exercises/practice/poker/src/main/java/Poker.java +++ b/exercises/practice/poker/src/main/java/Poker.java @@ -1,10 +1,13 @@ -/* +import java.util.List; -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. +class Poker { -Please remove this comment when submitting your solution. + Poker(final List hand) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ + List getBestHands() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + +} \ No newline at end of file From 12de7406dc3b3936fd1a8b4672304af24eca1c73 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 20:37:21 +0200 Subject: [PATCH 35/49] Add exercise stub for 'prime-factors' exercise --- .../src/main/java/PrimeFactorsCalculator.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/exercises/practice/prime-factors/src/main/java/PrimeFactorsCalculator.java b/exercises/practice/prime-factors/src/main/java/PrimeFactorsCalculator.java index 6178f1beb..6c4e5a618 100644 --- a/exercises/practice/prime-factors/src/main/java/PrimeFactorsCalculator.java +++ b/exercises/practice/prime-factors/src/main/java/PrimeFactorsCalculator.java @@ -1,10 +1,8 @@ -/* +import java.util.List; -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. +class PrimeFactorsCalculator { -Please remove this comment when submitting your solution. - -*/ + List calculatePrimeFactorsOf(final int number) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } +} \ No newline at end of file From dad1ece8d525bcdb0818ed513321d70f21daf0cc Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 20:45:16 +0200 Subject: [PATCH 36/49] Add exercise stub for 'pythagorean-triplet' exercise --- .../src/main/java/PythagoreanTriplet.java | 33 +++++++++++++++---- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/exercises/practice/pythagorean-triplet/src/main/java/PythagoreanTriplet.java b/exercises/practice/pythagorean-triplet/src/main/java/PythagoreanTriplet.java index 6178f1beb..9f806292b 100644 --- a/exercises/practice/pythagorean-triplet/src/main/java/PythagoreanTriplet.java +++ b/exercises/practice/pythagorean-triplet/src/main/java/PythagoreanTriplet.java @@ -1,10 +1,29 @@ -/* +import java.util.List; -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. +class PythagoreanTriplet { -Please remove this comment when submitting your solution. + PythagoreanTriplet(final int a, final int b, final int c) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ + TripletListBuilder makeTripletsList() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + class TripletListBuilder { + + TripletListBuilder thatSumTo(final int sum) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + TripletListBuilder withFactorsLessThanOrEqualTo(final int maxFactor) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + List build() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + } + +} \ No newline at end of file From 1da6ea3197a318930fe893a52a8451c00d947507 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 20:45:54 +0200 Subject: [PATCH 37/49] Fix formatting in 'prime-factors' --- .../prime-factors/src/main/java/PrimeFactorsCalculator.java | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/practice/prime-factors/src/main/java/PrimeFactorsCalculator.java b/exercises/practice/prime-factors/src/main/java/PrimeFactorsCalculator.java index 6c4e5a618..5a3fae32b 100644 --- a/exercises/practice/prime-factors/src/main/java/PrimeFactorsCalculator.java +++ b/exercises/practice/prime-factors/src/main/java/PrimeFactorsCalculator.java @@ -5,4 +5,5 @@ class PrimeFactorsCalculator { List calculatePrimeFactorsOf(final int number) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } + } \ No newline at end of file From c8c71a780f40ee9edd65f9dfea3b5850f08da5b2 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 20:59:14 +0200 Subject: [PATCH 38/49] Add exercise stub for 'queen-attack' exercise --- .../queen-attack/src/main/java/Queen.java | 7 +++++++ .../src/main/java/QueenAttackCalculator.java | 15 ++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 exercises/practice/queen-attack/src/main/java/Queen.java diff --git a/exercises/practice/queen-attack/src/main/java/Queen.java b/exercises/practice/queen-attack/src/main/java/Queen.java new file mode 100644 index 000000000..112481bdb --- /dev/null +++ b/exercises/practice/queen-attack/src/main/java/Queen.java @@ -0,0 +1,7 @@ +class Queen { + + Queen(final int row, final int column) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + +} diff --git a/exercises/practice/queen-attack/src/main/java/QueenAttackCalculator.java b/exercises/practice/queen-attack/src/main/java/QueenAttackCalculator.java index 6178f1beb..be2c3aa40 100644 --- a/exercises/practice/queen-attack/src/main/java/QueenAttackCalculator.java +++ b/exercises/practice/queen-attack/src/main/java/QueenAttackCalculator.java @@ -1,10 +1,11 @@ -/* +class QueenAttackCalculator { -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. + QueenAttackCalculator(final Queen queen1, final Queen queen2) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -Please remove this comment when submitting your solution. + boolean canQueensAttackOneAnother() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ +} \ No newline at end of file From eacec26bd9b255d33ac7304f41ac638292761240 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 21:03:03 +0200 Subject: [PATCH 39/49] Add exercise stub for 'rail-fence-cipher' exercise --- .../src/main/java/RailFenceCipher.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/exercises/practice/rail-fence-cipher/src/main/java/RailFenceCipher.java b/exercises/practice/rail-fence-cipher/src/main/java/RailFenceCipher.java index 6178f1beb..bb15244da 100644 --- a/exercises/practice/rail-fence-cipher/src/main/java/RailFenceCipher.java +++ b/exercises/practice/rail-fence-cipher/src/main/java/RailFenceCipher.java @@ -1,10 +1,11 @@ -/* +class RailFenceCipher { -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. + RailFenceCipher(final int rows) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -Please remove this comment when submitting your solution. + String getEncryptedData(final String message) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ +} \ No newline at end of file From 467b161079e891e3e75c4ff78d566530e6863be5 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 21:05:17 +0200 Subject: [PATCH 40/49] Add exercise stub for 'rectangles' exercise --- .../rectangles/src/main/java/RectangleCounter.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/exercises/practice/rectangles/src/main/java/RectangleCounter.java b/exercises/practice/rectangles/src/main/java/RectangleCounter.java index 6178f1beb..e771b6851 100644 --- a/exercises/practice/rectangles/src/main/java/RectangleCounter.java +++ b/exercises/practice/rectangles/src/main/java/RectangleCounter.java @@ -1,10 +1,7 @@ -/* +class RectangleCounter { -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. + int countRectangles(final String[] grid) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -Please remove this comment when submitting your solution. - -*/ +} \ No newline at end of file From fe919322d5f161f2b5552eb2d5e0ee2b3f3df983 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 21:10:03 +0200 Subject: [PATCH 41/49] Add exercise stub for 'rest-api' exercise --- .../rest-api/src/main/java/RestApi.java | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/exercises/practice/rest-api/src/main/java/RestApi.java b/exercises/practice/rest-api/src/main/java/RestApi.java index 6178f1beb..325f18082 100644 --- a/exercises/practice/rest-api/src/main/java/RestApi.java +++ b/exercises/practice/rest-api/src/main/java/RestApi.java @@ -1,10 +1,21 @@ -/* +import org.json.JSONObject; -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. +class RestApi { -Please remove this comment when submitting your solution. + RestApi(User... users) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ + String get(String url) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + String get(String url, JSONObject payload) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + String post(String url, JSONObject payload) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + +} \ No newline at end of file From c9ccb3993b48773dd856daa978dbb6b7ba06fe6f Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 21:15:15 +0200 Subject: [PATCH 42/49] Add exercise stub for 'robot-simulator' exercise Maybe we want to change the return type of the move functions to allow for method chaining like the solution suggests - it is not strictly necessary to sucessfully run the tests --- .../robot-simulator/src/main/java/Robot.java | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/exercises/practice/robot-simulator/src/main/java/Robot.java b/exercises/practice/robot-simulator/src/main/java/Robot.java index 6178f1beb..3f73de5cd 100644 --- a/exercises/practice/robot-simulator/src/main/java/Robot.java +++ b/exercises/practice/robot-simulator/src/main/java/Robot.java @@ -1,10 +1,31 @@ -/* +class Robot { -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. + Robot(GridPosition initialPosition, Orientation initialOrientation) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -Please remove this comment when submitting your solution. + GridPosition getGridPosition() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ + Orientation getOrientation() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + void advance() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + void turnLeft() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + void turnRight() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + + void simulate() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } + +} \ No newline at end of file From 683e4ed5f046798e458653bcd4b77af0f9237f81 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 21:19:05 +0200 Subject: [PATCH 43/49] Add exercise stub for 'robot-name' exercise --- .../practice/robot-name/src/main/java/Robot.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/exercises/practice/robot-name/src/main/java/Robot.java b/exercises/practice/robot-name/src/main/java/Robot.java index 6178f1beb..ce9264952 100644 --- a/exercises/practice/robot-name/src/main/java/Robot.java +++ b/exercises/practice/robot-name/src/main/java/Robot.java @@ -1,10 +1,11 @@ -/* +class Robot { -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. + String getName() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -Please remove this comment when submitting your solution. + void reset() { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ +} \ No newline at end of file From 5fdcfe6d56e88b9dfa667c66af48f0d27e7b9239 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 21:21:10 +0200 Subject: [PATCH 44/49] Add exercise stub for 'roman-numerals' exercise --- .../roman-numerals/src/main/java/RomanNumerals.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/exercises/practice/roman-numerals/src/main/java/RomanNumerals.java b/exercises/practice/roman-numerals/src/main/java/RomanNumerals.java index 6178f1beb..86d5c694f 100644 --- a/exercises/practice/roman-numerals/src/main/java/RomanNumerals.java +++ b/exercises/practice/roman-numerals/src/main/java/RomanNumerals.java @@ -1,10 +1,7 @@ -/* +class RomanNumerals { -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. + RomanNumerals(final int number) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -Please remove this comment when submitting your solution. - -*/ +} \ No newline at end of file From 4c1835a5523e6bde17af6b8258970602b6a837d2 Mon Sep 17 00:00:00 2001 From: DWalz Date: Wed, 7 Jun 2023 21:25:11 +0200 Subject: [PATCH 45/49] Add exercise stub for 'run-length-encoding' exercise --- .../src/main/java/RunLengthEncoding.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/exercises/practice/run-length-encoding/src/main/java/RunLengthEncoding.java b/exercises/practice/run-length-encoding/src/main/java/RunLengthEncoding.java index 6178f1beb..f54fc9a47 100644 --- a/exercises/practice/run-length-encoding/src/main/java/RunLengthEncoding.java +++ b/exercises/practice/run-length-encoding/src/main/java/RunLengthEncoding.java @@ -1,10 +1,11 @@ -/* +class RunLengthEncoding { -Since this exercise has a difficulty of > 4 it doesn't come -with any starter implementation. -This is so that you get to practice creating classes and methods -which is an important part of programming in Java. + String encode(String data) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -Please remove this comment when submitting your solution. + String decode(String data) { + throw new UnsupportedOperationException("Delete this statement and write your own implementation."); + } -*/ +} \ No newline at end of file From 5b97a5b85fe271f628360c4822eda92e649bee31 Mon Sep 17 00:00:00 2001 From: DWalz Date: Sun, 11 Jun 2023 04:11:06 +0200 Subject: [PATCH 46/49] Make function parameters not final --- .../src/main/java/BaseConverter.java | 4 ++-- .../alphametics/src/main/java/Alphametics.java | 2 +- .../practice/anagram/src/main/java/Anagram.java | 4 ++-- .../atbash-cipher/src/main/java/Atbash.java | 4 ++-- .../bank-account/src/main/java/BankAccount.java | 4 ++-- .../beer-song/src/main/java/BeerSong.java | 2 +- exercises/practice/bob/src/main/java/Bob.java | 2 +- .../book-store/src/main/java/BookStore.java | 2 +- .../bowling/src/main/java/BowlingGame.java | 2 +- .../change/src/main/java/ChangeCalculator.java | 4 ++-- .../practice/clock/src/main/java/Clock.java | 4 ++-- .../src/main/java/ComplexNumber.java | 14 +++++++------- .../src/main/java/CryptoSquare.java | 2 +- .../custom-set/src/main/java/CustomSet.java | 16 ++++++++-------- .../src/main/java/DiffieHellman.java | 6 +++--- .../flatten-array/src/main/java/Flattener.java | 2 +- .../food-chain/src/main/java/FoodChain.java | 4 ++-- .../go-counting/src/main/java/GoCounting.java | 4 ++-- .../grade-school/src/main/java/School.java | 2 +- .../practice/grep/src/main/java/GrepTool.java | 2 +- .../practice/hangman/src/main/java/Hangman.java | 2 +- .../practice/house/src/main/java/House.java | 4 ++-- .../knapsack/src/main/java/Knapsack.java | 2 +- .../src/main/java/BracketChecker.java | 2 +- .../practice/meetup/src/main/java/Meetup.java | 2 +- .../src/main/java/MinesweeperBoard.java | 2 +- .../src/main/java/NucleotideCounter.java | 4 ++-- .../src/main/java/OpticalCharacterReader.java | 2 +- .../src/main/java/PalindromeCalculator.java | 2 +- .../src/main/java/ParallelLetterFrequency.java | 2 +- .../src/main/java/PascalsTriangleGenerator.java | 2 +- .../phone-number/src/main/java/PhoneNumber.java | 2 +- .../practice/poker/src/main/java/Poker.java | 2 +- .../src/main/java/PrimeFactorsCalculator.java | 2 +- .../src/main/java/PythagoreanTriplet.java | 6 +++--- .../queen-attack/src/main/java/Queen.java | 2 +- .../src/main/java/QueenAttackCalculator.java | 2 +- .../src/main/java/RailFenceCipher.java | 4 ++-- .../src/main/java/RectangleCounter.java | 2 +- .../src/main/java/RomanNumerals.java | 2 +- 40 files changed, 68 insertions(+), 68 deletions(-) diff --git a/exercises/practice/all-your-base/src/main/java/BaseConverter.java b/exercises/practice/all-your-base/src/main/java/BaseConverter.java index 832d1dfdc..c347144ec 100644 --- a/exercises/practice/all-your-base/src/main/java/BaseConverter.java +++ b/exercises/practice/all-your-base/src/main/java/BaseConverter.java @@ -1,10 +1,10 @@ class BaseConverter { - BaseConverter(final int originalBase, final int[] originalDigits) { + BaseConverter(int originalBase, int[] originalDigits) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - int[] convertToBase(final int newBase) { + int[] convertToBase(int newBase) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/alphametics/src/main/java/Alphametics.java b/exercises/practice/alphametics/src/main/java/Alphametics.java index d9e34053c..1ac637d9c 100644 --- a/exercises/practice/alphametics/src/main/java/Alphametics.java +++ b/exercises/practice/alphametics/src/main/java/Alphametics.java @@ -2,7 +2,7 @@ class Alphametics { - Alphametics(final String userInput) { + Alphametics(String userInput) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/anagram/src/main/java/Anagram.java b/exercises/practice/anagram/src/main/java/Anagram.java index 7c3b98284..e6044d7dc 100644 --- a/exercises/practice/anagram/src/main/java/Anagram.java +++ b/exercises/practice/anagram/src/main/java/Anagram.java @@ -2,11 +2,11 @@ class Anagram { - Anagram(final String word) { + Anagram(String word) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - List match(final List candidates) { + List match(List candidates) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/atbash-cipher/src/main/java/Atbash.java b/exercises/practice/atbash-cipher/src/main/java/Atbash.java index 9b1616499..e5ea2147a 100644 --- a/exercises/practice/atbash-cipher/src/main/java/Atbash.java +++ b/exercises/practice/atbash-cipher/src/main/java/Atbash.java @@ -1,10 +1,10 @@ class Atbash { - String encode(final String input) { + String encode(String input) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - String decode(final String input) { + String decode(String input) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/bank-account/src/main/java/BankAccount.java b/exercises/practice/bank-account/src/main/java/BankAccount.java index 95377a41a..61625bd6d 100644 --- a/exercises/practice/bank-account/src/main/java/BankAccount.java +++ b/exercises/practice/bank-account/src/main/java/BankAccount.java @@ -12,11 +12,11 @@ synchronized int getBalance() throws BankAccountActionInvalidException { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - synchronized void deposit(final int amount) throws BankAccountActionInvalidException { + synchronized void deposit(int amount) throws BankAccountActionInvalidException { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - synchronized void withdraw(final int amount) throws BankAccountActionInvalidException { + synchronized void withdraw(int amount) throws BankAccountActionInvalidException { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/beer-song/src/main/java/BeerSong.java b/exercises/practice/beer-song/src/main/java/BeerSong.java index 9e9de4339..9fe51b1f5 100644 --- a/exercises/practice/beer-song/src/main/java/BeerSong.java +++ b/exercises/practice/beer-song/src/main/java/BeerSong.java @@ -1,6 +1,6 @@ class BeerSong { - String sing(final int startBottles, final int takeDown) { + String sing(int startBottles, int takeDown) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/bob/src/main/java/Bob.java b/exercises/practice/bob/src/main/java/Bob.java index 680b5e5cf..75d18c343 100644 --- a/exercises/practice/bob/src/main/java/Bob.java +++ b/exercises/practice/bob/src/main/java/Bob.java @@ -1,6 +1,6 @@ class Bob { - String hey(final String input) { + String hey(String input) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/book-store/src/main/java/BookStore.java b/exercises/practice/book-store/src/main/java/BookStore.java index e0f9f1ddd..f0f2e09fc 100644 --- a/exercises/practice/book-store/src/main/java/BookStore.java +++ b/exercises/practice/book-store/src/main/java/BookStore.java @@ -2,7 +2,7 @@ class BookStore { - double calculateBasketCost(final List books) { + double calculateBasketCost(List books) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/bowling/src/main/java/BowlingGame.java b/exercises/practice/bowling/src/main/java/BowlingGame.java index 5823a97b1..0a84e90da 100644 --- a/exercises/practice/bowling/src/main/java/BowlingGame.java +++ b/exercises/practice/bowling/src/main/java/BowlingGame.java @@ -1,6 +1,6 @@ class BowlingGame { - void roll(final int pins) { + void roll(int pins) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/change/src/main/java/ChangeCalculator.java b/exercises/practice/change/src/main/java/ChangeCalculator.java index 2073a80fd..658ff749c 100644 --- a/exercises/practice/change/src/main/java/ChangeCalculator.java +++ b/exercises/practice/change/src/main/java/ChangeCalculator.java @@ -2,11 +2,11 @@ class ChangeCalculator { - ChangeCalculator(final List currencyCoins) { + ChangeCalculator(List currencyCoins) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - List computeMostEfficientChange(final int grandTotal) { + List computeMostEfficientChange(int grandTotal) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/clock/src/main/java/Clock.java b/exercises/practice/clock/src/main/java/Clock.java index bcefd382a..91ede5436 100644 --- a/exercises/practice/clock/src/main/java/Clock.java +++ b/exercises/practice/clock/src/main/java/Clock.java @@ -1,10 +1,10 @@ class Clock { - Clock(final int hours, final int minutes) { + Clock(int hours, int minutes) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - void add(final int minutes) { + void add(int minutes) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/complex-numbers/src/main/java/ComplexNumber.java b/exercises/practice/complex-numbers/src/main/java/ComplexNumber.java index 234dd5930..88c32482b 100644 --- a/exercises/practice/complex-numbers/src/main/java/ComplexNumber.java +++ b/exercises/practice/complex-numbers/src/main/java/ComplexNumber.java @@ -1,6 +1,6 @@ class ComplexNumber { - ComplexNumber(final double real, final double imag) { + ComplexNumber(double real, double imag) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } @@ -16,27 +16,27 @@ class ComplexNumber { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - ComplexNumber add(final ComplexNumber other) { + ComplexNumber add(ComplexNumber other) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - ComplexNumber minus(final ComplexNumber other) { + ComplexNumber minus(ComplexNumber other) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - ComplexNumber times(final ComplexNumber other) { + ComplexNumber times(ComplexNumber other) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - ComplexNumber times(final double factor) { + ComplexNumber times(double factor) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - ComplexNumber div(final ComplexNumber other) { + ComplexNumber div(ComplexNumber other) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - ComplexNumber div(final double divisor) { + ComplexNumber div(double divisor) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/crypto-square/src/main/java/CryptoSquare.java b/exercises/practice/crypto-square/src/main/java/CryptoSquare.java index 3cbbbec84..799c56095 100644 --- a/exercises/practice/crypto-square/src/main/java/CryptoSquare.java +++ b/exercises/practice/crypto-square/src/main/java/CryptoSquare.java @@ -1,6 +1,6 @@ class CryptoSquare { - CryptoSquare(final String plaintext) { + CryptoSquare(String plaintext) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/custom-set/src/main/java/CustomSet.java b/exercises/practice/custom-set/src/main/java/CustomSet.java index 3eab32867..2903faeaf 100644 --- a/exercises/practice/custom-set/src/main/java/CustomSet.java +++ b/exercises/practice/custom-set/src/main/java/CustomSet.java @@ -6,7 +6,7 @@ class CustomSet { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - CustomSet(final Collection data) { + CustomSet(Collection data) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } @@ -14,32 +14,32 @@ boolean isEmpty() { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - boolean contains(final T element) { + boolean contains(T element) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - boolean isDisjoint(final CustomSet other) { + boolean isDisjoint(CustomSet other) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - boolean add(final T element) { + boolean add(T element) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } @Override - public boolean equals(final Object obj) { + public boolean equals(Object obj) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - CustomSet getIntersection(final CustomSet other) { + CustomSet getIntersection(CustomSet other) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - CustomSet getUnion(final CustomSet other) { + CustomSet getUnion(CustomSet other) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - CustomSet getDifference(final CustomSet other) { + CustomSet getDifference(CustomSet other) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/diffie-hellman/src/main/java/DiffieHellman.java b/exercises/practice/diffie-hellman/src/main/java/DiffieHellman.java index 80fb3a258..985b537d5 100644 --- a/exercises/practice/diffie-hellman/src/main/java/DiffieHellman.java +++ b/exercises/practice/diffie-hellman/src/main/java/DiffieHellman.java @@ -2,15 +2,15 @@ class DiffieHellman { - BigInteger privateKey(final BigInteger primeP) { + BigInteger privateKey(BigInteger primeP) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - BigInteger publicKey(final BigInteger primeP, final BigInteger primeG, final BigInteger privateKey) { + BigInteger publicKey(BigInteger primeP, BigInteger primeG, BigInteger privateKey) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - BigInteger secret(final BigInteger primeP, final BigInteger publicKey, final BigInteger privateKey) { + BigInteger secret(BigInteger primeP, BigInteger publicKey, BigInteger privateKey) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/flatten-array/src/main/java/Flattener.java b/exercises/practice/flatten-array/src/main/java/Flattener.java index 75c543680..c2759577f 100644 --- a/exercises/practice/flatten-array/src/main/java/Flattener.java +++ b/exercises/practice/flatten-array/src/main/java/Flattener.java @@ -2,7 +2,7 @@ class Flattener { - List flatten(final List list) { + List flatten(List list) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/food-chain/src/main/java/FoodChain.java b/exercises/practice/food-chain/src/main/java/FoodChain.java index 191fbc545..194494cd6 100644 --- a/exercises/practice/food-chain/src/main/java/FoodChain.java +++ b/exercises/practice/food-chain/src/main/java/FoodChain.java @@ -1,10 +1,10 @@ class FoodChain { - String verse(final int verse) { + String verse(int verse) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - String verses(final int startVerse, final int endVerse) { + String verses(int startVerse, int endVerse) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/go-counting/src/main/java/GoCounting.java b/exercises/practice/go-counting/src/main/java/GoCounting.java index 1d9d979b9..23907fdd5 100644 --- a/exercises/practice/go-counting/src/main/java/GoCounting.java +++ b/exercises/practice/go-counting/src/main/java/GoCounting.java @@ -8,11 +8,11 @@ class GoCounting { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - Player getTerritoryOwner(final int x, final int y) { + Player getTerritoryOwner(int x, int y) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - Set getTerritory(final int x, final int y) { + Set getTerritory(int x, int y) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/grade-school/src/main/java/School.java b/exercises/practice/grade-school/src/main/java/School.java index 887e17edf..599b475d8 100644 --- a/exercises/practice/grade-school/src/main/java/School.java +++ b/exercises/practice/grade-school/src/main/java/School.java @@ -2,7 +2,7 @@ class School { - void add(final String student, final int grade) { + void add(String student, int grade) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/grep/src/main/java/GrepTool.java b/exercises/practice/grep/src/main/java/GrepTool.java index 29e72ce27..762980881 100644 --- a/exercises/practice/grep/src/main/java/GrepTool.java +++ b/exercises/practice/grep/src/main/java/GrepTool.java @@ -2,7 +2,7 @@ class GrepTool { - String grep(final String pattern, final List flags, final List files) { + String grep(String pattern, List flags, List files) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/hangman/src/main/java/Hangman.java b/exercises/practice/hangman/src/main/java/Hangman.java index 81f9ddb40..abab3240f 100644 --- a/exercises/practice/hangman/src/main/java/Hangman.java +++ b/exercises/practice/hangman/src/main/java/Hangman.java @@ -2,7 +2,7 @@ class Hangman { - Observable play(final Observable words, final Observable letters) { + Observable play(Observable words, Observable letters) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/house/src/main/java/House.java b/exercises/practice/house/src/main/java/House.java index 34b93e159..409de0aac 100644 --- a/exercises/practice/house/src/main/java/House.java +++ b/exercises/practice/house/src/main/java/House.java @@ -1,10 +1,10 @@ class House { - String verse(final int verse) { + String verse(int verse) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - String verses(final int startVerse, final int endVerse) { + String verses(int startVerse, int endVerse) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/knapsack/src/main/java/Knapsack.java b/exercises/practice/knapsack/src/main/java/Knapsack.java index 2f7630892..42891b353 100644 --- a/exercises/practice/knapsack/src/main/java/Knapsack.java +++ b/exercises/practice/knapsack/src/main/java/Knapsack.java @@ -2,7 +2,7 @@ class Knapsack { - int maximumValue(final int maximumWeight, List items) { + int maximumValue(int maximumWeight, List items) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/matching-brackets/src/main/java/BracketChecker.java b/exercises/practice/matching-brackets/src/main/java/BracketChecker.java index 72fcaca66..906f68315 100644 --- a/exercises/practice/matching-brackets/src/main/java/BracketChecker.java +++ b/exercises/practice/matching-brackets/src/main/java/BracketChecker.java @@ -1,6 +1,6 @@ class BracketChecker { - BracketChecker(final String expression) { + BracketChecker(String expression) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/meetup/src/main/java/Meetup.java b/exercises/practice/meetup/src/main/java/Meetup.java index c0c31cd03..c53792961 100644 --- a/exercises/practice/meetup/src/main/java/Meetup.java +++ b/exercises/practice/meetup/src/main/java/Meetup.java @@ -3,7 +3,7 @@ class Meetup { - Meetup(final int monthOfYear, final int year) { + Meetup(int monthOfYear, int year) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/minesweeper/src/main/java/MinesweeperBoard.java b/exercises/practice/minesweeper/src/main/java/MinesweeperBoard.java index 1011d1c08..2ab5ef342 100644 --- a/exercises/practice/minesweeper/src/main/java/MinesweeperBoard.java +++ b/exercises/practice/minesweeper/src/main/java/MinesweeperBoard.java @@ -2,7 +2,7 @@ class MinesweeperBoard { - MinesweeperBoard(final List boardRows) { + MinesweeperBoard(List boardRows) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/nucleotide-count/src/main/java/NucleotideCounter.java b/exercises/practice/nucleotide-count/src/main/java/NucleotideCounter.java index d2acb11a2..2a349e479 100644 --- a/exercises/practice/nucleotide-count/src/main/java/NucleotideCounter.java +++ b/exercises/practice/nucleotide-count/src/main/java/NucleotideCounter.java @@ -2,11 +2,11 @@ class NucleotideCounter { - NucleotideCounter(final String sequence) { + NucleotideCounter(String sequence) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - int count(final char base) { + int count(char base) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/ocr-numbers/src/main/java/OpticalCharacterReader.java b/exercises/practice/ocr-numbers/src/main/java/OpticalCharacterReader.java index f4a07841f..cbbe27cd9 100644 --- a/exercises/practice/ocr-numbers/src/main/java/OpticalCharacterReader.java +++ b/exercises/practice/ocr-numbers/src/main/java/OpticalCharacterReader.java @@ -2,7 +2,7 @@ class OpticalCharacterReader { - String parse(final List input) { + String parse(List input) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/palindrome-products/src/main/java/PalindromeCalculator.java b/exercises/practice/palindrome-products/src/main/java/PalindromeCalculator.java index e9d0575ac..bf8bdb8e7 100644 --- a/exercises/practice/palindrome-products/src/main/java/PalindromeCalculator.java +++ b/exercises/practice/palindrome-products/src/main/java/PalindromeCalculator.java @@ -3,7 +3,7 @@ class PalindromeCalculator { - SortedMap>> getPalindromeProductsWithFactors(final int minFactor, final int maxFactor) { + SortedMap>> getPalindromeProductsWithFactors(int minFactor, int maxFactor) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/parallel-letter-frequency/src/main/java/ParallelLetterFrequency.java b/exercises/practice/parallel-letter-frequency/src/main/java/ParallelLetterFrequency.java index eaff971cd..93f41ee86 100644 --- a/exercises/practice/parallel-letter-frequency/src/main/java/ParallelLetterFrequency.java +++ b/exercises/practice/parallel-letter-frequency/src/main/java/ParallelLetterFrequency.java @@ -2,7 +2,7 @@ class ParallelLetterFrequency { - ParallelLetterFrequency(final String letters) { + ParallelLetterFrequency(String letters) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/pascals-triangle/src/main/java/PascalsTriangleGenerator.java b/exercises/practice/pascals-triangle/src/main/java/PascalsTriangleGenerator.java index 8b74db8d8..eb2480bc4 100644 --- a/exercises/practice/pascals-triangle/src/main/java/PascalsTriangleGenerator.java +++ b/exercises/practice/pascals-triangle/src/main/java/PascalsTriangleGenerator.java @@ -1,6 +1,6 @@ class PascalsTriangleGenerator { - int[][] generateTriangle(final int rows) { + int[][] generateTriangle(int rows) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/phone-number/src/main/java/PhoneNumber.java b/exercises/practice/phone-number/src/main/java/PhoneNumber.java index b22866dc8..20bd0cf0c 100644 --- a/exercises/practice/phone-number/src/main/java/PhoneNumber.java +++ b/exercises/practice/phone-number/src/main/java/PhoneNumber.java @@ -1,6 +1,6 @@ class PhoneNumber { - PhoneNumber(final String numberString) { + PhoneNumber(String numberString) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/poker/src/main/java/Poker.java b/exercises/practice/poker/src/main/java/Poker.java index 4f2b1b161..c6ed7e8a6 100644 --- a/exercises/practice/poker/src/main/java/Poker.java +++ b/exercises/practice/poker/src/main/java/Poker.java @@ -2,7 +2,7 @@ class Poker { - Poker(final List hand) { + Poker(List hand) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/prime-factors/src/main/java/PrimeFactorsCalculator.java b/exercises/practice/prime-factors/src/main/java/PrimeFactorsCalculator.java index 5a3fae32b..a7ed6ad39 100644 --- a/exercises/practice/prime-factors/src/main/java/PrimeFactorsCalculator.java +++ b/exercises/practice/prime-factors/src/main/java/PrimeFactorsCalculator.java @@ -2,7 +2,7 @@ class PrimeFactorsCalculator { - List calculatePrimeFactorsOf(final int number) { + List calculatePrimeFactorsOf(int number) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/pythagorean-triplet/src/main/java/PythagoreanTriplet.java b/exercises/practice/pythagorean-triplet/src/main/java/PythagoreanTriplet.java index 9f806292b..7d309abea 100644 --- a/exercises/practice/pythagorean-triplet/src/main/java/PythagoreanTriplet.java +++ b/exercises/practice/pythagorean-triplet/src/main/java/PythagoreanTriplet.java @@ -2,7 +2,7 @@ class PythagoreanTriplet { - PythagoreanTriplet(final int a, final int b, final int c) { + PythagoreanTriplet(int a, int b, int c) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } @@ -12,11 +12,11 @@ TripletListBuilder makeTripletsList() { class TripletListBuilder { - TripletListBuilder thatSumTo(final int sum) { + TripletListBuilder thatSumTo(int sum) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - TripletListBuilder withFactorsLessThanOrEqualTo(final int maxFactor) { + TripletListBuilder withFactorsLessThanOrEqualTo(int maxFactor) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/queen-attack/src/main/java/Queen.java b/exercises/practice/queen-attack/src/main/java/Queen.java index 112481bdb..8cd04fb24 100644 --- a/exercises/practice/queen-attack/src/main/java/Queen.java +++ b/exercises/practice/queen-attack/src/main/java/Queen.java @@ -1,6 +1,6 @@ class Queen { - Queen(final int row, final int column) { + Queen(int row, int column) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/queen-attack/src/main/java/QueenAttackCalculator.java b/exercises/practice/queen-attack/src/main/java/QueenAttackCalculator.java index be2c3aa40..b30a9d95e 100644 --- a/exercises/practice/queen-attack/src/main/java/QueenAttackCalculator.java +++ b/exercises/practice/queen-attack/src/main/java/QueenAttackCalculator.java @@ -1,6 +1,6 @@ class QueenAttackCalculator { - QueenAttackCalculator(final Queen queen1, final Queen queen2) { + QueenAttackCalculator(Queen queen1, Queen queen2) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/rail-fence-cipher/src/main/java/RailFenceCipher.java b/exercises/practice/rail-fence-cipher/src/main/java/RailFenceCipher.java index bb15244da..4cc76cd68 100644 --- a/exercises/practice/rail-fence-cipher/src/main/java/RailFenceCipher.java +++ b/exercises/practice/rail-fence-cipher/src/main/java/RailFenceCipher.java @@ -1,10 +1,10 @@ class RailFenceCipher { - RailFenceCipher(final int rows) { + RailFenceCipher(int rows) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } - String getEncryptedData(final String message) { + String getEncryptedData(String message) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/rectangles/src/main/java/RectangleCounter.java b/exercises/practice/rectangles/src/main/java/RectangleCounter.java index e771b6851..c3b7e4d2a 100644 --- a/exercises/practice/rectangles/src/main/java/RectangleCounter.java +++ b/exercises/practice/rectangles/src/main/java/RectangleCounter.java @@ -1,6 +1,6 @@ class RectangleCounter { - int countRectangles(final String[] grid) { + int countRectangles(String[] grid) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } diff --git a/exercises/practice/roman-numerals/src/main/java/RomanNumerals.java b/exercises/practice/roman-numerals/src/main/java/RomanNumerals.java index 86d5c694f..06dd749ed 100644 --- a/exercises/practice/roman-numerals/src/main/java/RomanNumerals.java +++ b/exercises/practice/roman-numerals/src/main/java/RomanNumerals.java @@ -1,6 +1,6 @@ class RomanNumerals { - RomanNumerals(final int number) { + RomanNumerals(int number) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } From 6a5d7f261c6a13fc46752fd4c269145ad48794d3 Mon Sep 17 00:00:00 2001 From: Sander Ploegsma Date: Sat, 26 Aug 2023 09:53:38 +0200 Subject: [PATCH 47/49] Fix Gradle dependencies in starterSource source sets Projects that add external dependencies using the `implementation` dependency configuration in their build.gradle file didn't get those dependencies installed when building the 'starterSource' source sets in CI. --- exercises/build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/exercises/build.gradle b/exercises/build.gradle index 0a019cfab..61b8e4a1a 100644 --- a/exercises/build.gradle +++ b/exercises/build.gradle @@ -57,7 +57,10 @@ subprojects { logCompileTaskSourcePath(project, "compileJava") // Corresponds to the "main" source set. logCompileTaskSourcePath(project, "compileStarterSourceJava") logCompileTaskSourcePath(project, "compileTestJava") + } + configurations { + starterSourceImplementation.extendsFrom implementation } // configuration of the linter From c25e82f0855b1454f439bb45a815da5374499c83 Mon Sep 17 00:00:00 2001 From: DWalz Date: Sat, 26 Aug 2023 14:20:22 +0200 Subject: [PATCH 48/49] Add missing Item class for knapsack exercise --- exercises/practice/knapsack/src/main/java/Item.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 exercises/practice/knapsack/src/main/java/Item.java diff --git a/exercises/practice/knapsack/src/main/java/Item.java b/exercises/practice/knapsack/src/main/java/Item.java new file mode 100644 index 000000000..dcea2b38d --- /dev/null +++ b/exercises/practice/knapsack/src/main/java/Item.java @@ -0,0 +1,13 @@ +class Item { + + // Weight of the item + int weight; + // Value of the item + int value; + + Item(int itemWeight, int itemValue) { + this.weight = itemWeight; + this.value = itemValue; + } + +} From b5ab85a19462f5b56d8224101ceeabb2f6c1dea0 Mon Sep 17 00:00:00 2001 From: DWalz Date: Sat, 26 Aug 2023 14:45:21 +0200 Subject: [PATCH 49/49] Add new files to exercise config --- exercises/practice/knapsack/.meta/config.json | 3 +++ exercises/practice/queen-attack/.meta/config.json | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/exercises/practice/knapsack/.meta/config.json b/exercises/practice/knapsack/.meta/config.json index 7383fe9a4..260ef5f9c 100644 --- a/exercises/practice/knapsack/.meta/config.json +++ b/exercises/practice/knapsack/.meta/config.json @@ -18,6 +18,9 @@ "example": [ ".meta/src/reference/java/Knapsack.java" ], + "editor": [ + "src/main/java/Item.java" + ], "invalidator": [ "build.gradle" ] diff --git a/exercises/practice/queen-attack/.meta/config.json b/exercises/practice/queen-attack/.meta/config.json index 3d7f952e9..135333f94 100644 --- a/exercises/practice/queen-attack/.meta/config.json +++ b/exercises/practice/queen-attack/.meta/config.json @@ -25,7 +25,8 @@ ], "files": { "solution": [ - "src/main/java/QueenAttackCalculator.java" + "src/main/java/QueenAttackCalculator.java", + "src/main/java/Queen.java" ], "test": [ "src/test/java/QueenAttackCalculatorTest.java"