/*
*
**
***
****
*****
*/
for($line=1; $line<=5; ++$line){
for($pos=1; $pos<=$line; ++$pos){
echo '*';
}
echo '
';
}
/*
*
***
*****
*******
*********
*/
echo '
';
for($line=1; $line<=5; ++$line){
for($pos=1, $max=2*$line-1; $pos<=$max; ++$pos){
echo '*';
}
echo '
';
}
/*
*
***
*****
*******
*********
*/
echo '
';
for($line=1; $line<=5; ++$line){
for($pos=1, $max=5-$line; $pos<=$max; ++$pos){
echo ' ';
}
for($pos=1, $max=2*$line-1; $pos<=$max; ++$pos){
echo '*';
}
echo '
';
}
/*
*
* *
* *
* *
* *
*/
echo '
';
for($line=1; $line<=5; ++$line){
for($pos=1, $max=5-$line; $pos<=$max; ++$pos){
echo ' ';
}
for($pos=1, $max=2*$line-1; $pos<=$max; ++$pos){
if($pos==1 || $pos==$max){
echo '*';
}else{
echo ' ';
}
}
echo '
';
}
/*
*
* *
* *
* *
*********
*/
echo '
';
for($line=1; $line<=5; ++$line){
for($pos=1, $max=5-$line; $pos<=$max; ++$pos){
echo ' ';
}
for($pos=1, $max=2*$line-1; $pos<=$max; ++$pos){
if($pos==1 || $pos==$max || $line==5){
echo '*';
}else{
echo ' ';
}
}
echo '
';
}
/*
*
* *
* *
* *
* *
* *
* *
* *
*
*/
echo '
';
for($line=1; $line<=5; ++$line){
for($pos=1, $max=5-$line; $pos<=$max; ++$pos){
echo ' ';
}
for($pos=1, $max=2*$line-1; $pos<=$max; ++$pos){
if($pos==1 || $pos==$max){
echo '*';
}else{
echo ' ';
}
}
echo '
';
}
for($line=4; $line>=1; --$line){
for($pos=5-$line; $pos>=1; --$pos){
echo ' ';
}
for($pos=1, $max=2*$line-1; $pos<=$max; ++$pos){
if($pos==1 || $pos==$max){
echo '*';
}else{
echo ' ';
}
}
echo '
';
}