Created
February 21, 2022 17:04
-
-
Save sidneisimeao/acdccae3a6a21465b2d772484b512acc to your computer and use it in GitHub Desktop.
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
<?php | |
function construirEscada($degraus) | |
{ | |
$escada = ''; | |
for ($i = 0; $i < $degraus; $i++) { | |
$escada .= str_repeat(' ', $degraus - $i) | |
. str_repeat('*', $i + 1) . "\n"; | |
} | |
return $escada; | |
} | |
echo construirEscada(6); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment