diff --git a/challenges/print-pyramid/README.md b/challenges/print-pyramid/README.md new file mode 100644 index 0000000..46008ce --- /dev/null +++ b/challenges/print-pyramid/README.md @@ -0,0 +1,50 @@ +# print-pyramid + +Created by [@Divlo](https://github.com/Divlo) on 21 September 2021. + +## Instructions + +Display a pyramid of stars (`*`) whose height is given and in the right order (`normal` or `reverse`). + +### Input + +- **Line 1:** The string : `normal` or `reverse` to determine how to show the pyramid. +- **Line 2:** The integer : height of the pyramid. + +## Examples + +See the `test` folder for examples of input/output. + +### Example 1 + +#### Input + +```txt +normal +3 +``` + +#### Output + +```txt + * + *** +***** +``` + +### Example 2 + +#### Input + +```txt +reverse +3 +``` + +#### Output + +```txt +***** + *** + * +``` diff --git a/challenges/print-pyramid/solutions/.gitkeep b/challenges/print-pyramid/solutions/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/challenges/print-pyramid/test/1/input.txt b/challenges/print-pyramid/test/1/input.txt new file mode 100644 index 0000000..cb89aa1 --- /dev/null +++ b/challenges/print-pyramid/test/1/input.txt @@ -0,0 +1,2 @@ +normal +3 \ No newline at end of file diff --git a/challenges/print-pyramid/test/1/output.txt b/challenges/print-pyramid/test/1/output.txt new file mode 100644 index 0000000..db83597 --- /dev/null +++ b/challenges/print-pyramid/test/1/output.txt @@ -0,0 +1,3 @@ + * + *** +***** \ No newline at end of file diff --git a/challenges/print-pyramid/test/2/input.txt b/challenges/print-pyramid/test/2/input.txt new file mode 100644 index 0000000..fa8bea8 --- /dev/null +++ b/challenges/print-pyramid/test/2/input.txt @@ -0,0 +1,2 @@ +reverse +3 \ No newline at end of file diff --git a/challenges/print-pyramid/test/2/output.txt b/challenges/print-pyramid/test/2/output.txt new file mode 100644 index 0000000..29ba1ed --- /dev/null +++ b/challenges/print-pyramid/test/2/output.txt @@ -0,0 +1,3 @@ +***** + *** + * \ No newline at end of file diff --git a/challenges/print-pyramid/test/3/input.txt b/challenges/print-pyramid/test/3/input.txt new file mode 100644 index 0000000..3a364e8 --- /dev/null +++ b/challenges/print-pyramid/test/3/input.txt @@ -0,0 +1,2 @@ +normal +8 \ No newline at end of file diff --git a/challenges/print-pyramid/test/3/output.txt b/challenges/print-pyramid/test/3/output.txt new file mode 100644 index 0000000..592d168 --- /dev/null +++ b/challenges/print-pyramid/test/3/output.txt @@ -0,0 +1,8 @@ + * + *** + ***** + ******* + ********* + *********** + ************* +*************** \ No newline at end of file diff --git a/challenges/print-pyramid/test/4/input.txt b/challenges/print-pyramid/test/4/input.txt new file mode 100644 index 0000000..b32e042 --- /dev/null +++ b/challenges/print-pyramid/test/4/input.txt @@ -0,0 +1,2 @@ +reverse +8 \ No newline at end of file diff --git a/challenges/print-pyramid/test/4/output.txt b/challenges/print-pyramid/test/4/output.txt new file mode 100644 index 0000000..f6ce8e5 --- /dev/null +++ b/challenges/print-pyramid/test/4/output.txt @@ -0,0 +1,8 @@ +*************** + ************* + *********** + ********* + ******* + ***** + *** + * \ No newline at end of file diff --git a/challenges/print-pyramid/test/5/input.txt b/challenges/print-pyramid/test/5/input.txt new file mode 100644 index 0000000..abb29e6 --- /dev/null +++ b/challenges/print-pyramid/test/5/input.txt @@ -0,0 +1,2 @@ +normal +9 \ No newline at end of file diff --git a/challenges/print-pyramid/test/5/output.txt b/challenges/print-pyramid/test/5/output.txt new file mode 100644 index 0000000..c0cc95e --- /dev/null +++ b/challenges/print-pyramid/test/5/output.txt @@ -0,0 +1,9 @@ + * + *** + ***** + ******* + ********* + *********** + ************* + *************** +***************** \ No newline at end of file diff --git a/challenges/print-pyramid/test/6/input.txt b/challenges/print-pyramid/test/6/input.txt new file mode 100644 index 0000000..4922ace --- /dev/null +++ b/challenges/print-pyramid/test/6/input.txt @@ -0,0 +1,2 @@ +reverse +9 \ No newline at end of file diff --git a/challenges/print-pyramid/test/6/output.txt b/challenges/print-pyramid/test/6/output.txt new file mode 100644 index 0000000..e127c9a --- /dev/null +++ b/challenges/print-pyramid/test/6/output.txt @@ -0,0 +1,9 @@ +***************** + *************** + ************* + *********** + ********* + ******* + ***** + *** + * \ No newline at end of file