mirror of https://github.com/01-edu/public.git
1 changed files with 31 additions and 1 deletions
@ -1,3 +1,33 @@ |
|||||||
## 🌟 Diamon |
## 🌟 Diamon |
||||||
|
|
||||||
diamon (pyramid + reversed pyramid) |
### Instructions |
||||||
|
|
||||||
|
Create a `diamon` function that takes a string and a number as parameters |
||||||
|
and return a diamon shape constructed by 2 arguments: |
||||||
|
- the characters (as a string) to be repeated |
||||||
|
- the size of a side (as a number) |
||||||
|
|
||||||
|
Just like pyramid + a reversed pyramid |
||||||
|
|
||||||
|
### Output example |
||||||
|
|
||||||
|
- `*` character and side of 5 : |
||||||
|
|
||||||
|
``` |
||||||
|
* |
||||||
|
*** |
||||||
|
***** |
||||||
|
******* |
||||||
|
********* |
||||||
|
******* |
||||||
|
***** |
||||||
|
*** |
||||||
|
* |
||||||
|
``` |
||||||
|
|
||||||
|
> No new line in last line |
||||||
|
|
||||||
|
### Notions |
||||||
|
|
||||||
|
- [nan-academy.github.io/js-training/examples/loops](https://nan-academy.github.io/js-training/examples/loops.js) |
||||||
|
- [nan-academy.github.io/js-training/examples/recursion](https://nan-academy.github.io/js-training/examples/recursion.js) |
||||||
|
Loading…
Reference in new issue