Created
May 18, 2017 13:28
-
-
Save jehugaleahsa/bc1ae81bf9c0360e2710a5d096589127 to your computer and use it in GitHub Desktop.
Tree Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# let rows: 10 | |
# let lines = from row in 0..rows | |
# let spaceCount = rows - row | |
# let spaces = " " * spaceCount | |
# let stars = "*" * (2 * row + 1) | |
# let line = spaces + stars + spaces | |
# select line | |
# lines.join("\r\n") | |
$rows = 10 | |
$lines = @( | |
foreach ($row in 0..$rows) | |
{ | |
$spaceCount = $rows - $row | |
$spaces = " " * $spaceCount | |
$stars = "*" * (2 * $row + 1) | |
$line = $spaces + $stars + $spaces | |
$line | |
} | |
) | |
[System.String]::Join([System.Environment]::NewLine, $lines) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment