This application was written as a solution to the Give me a Diamond kata published on the Codewars website.
This application will accept a positive odd number input by the user, and return a string of asterisks to represent a diamond.
- Java 21 or above
- Access to command line interface / terminal
- Download
diamond.jarfrom the/out/artifacts/diamond_jar/directory of this repository. - Move the downloaded file to another local directory on your device of your choosing.
- Open your command line interface / terminal and navigate to the local location of
diamond.jar. - Run the application with the following command:
java -jar diamond.jar
Once you have run the application with the command above, you will be shown the following text:
So you want a diamond? The size must be provided as an odd positive number.
Please enter the required diamond size and hit ENTER.
So you want a diamond? The size must be provided as an odd positive number.
Please enter the required diamond size and hit ENTER.
7
*
***
*****
*******
*****
***
*
So you want a diamond? The size must be provided as an odd positive number.
Please enter the required diamond size and hit ENTER.
0
You must provide diamond size as a positive odd integer.
So you want a diamond? The size must be provided as an odd positive number.
Please enter the required diamond size and hit ENTER.
1
Too small. The smallest diamond possible is 3.