1
1
mirror of https://github.com/theoludwig/programming-challenges.git synced 2024-12-08 00:45:29 +01:00
programming-challenges/challenges/print-pyramid
2021-10-13 21:43:45 +02:00
..
solutions feat(cli): add --all option to run test command 2021-10-13 21:43:45 +02:00
test feat(challenges): add print-pyramid 2021-09-21 15:18:51 +02:00
README.md feat(challenges): add print-pyramid 2021-09-21 15:18:51 +02:00

print-pyramid

Created by @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

normal
3

Output

  *
 ***
*****

Example 2

Input

reverse
3

Output

*****
 ***
  *