Created
May 29, 2016 04:37
-
-
Save 3Shoka/93944f86eab6876b57d01dc4378c3606 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 | |
$a ="."; | |
$spc = " "; | |
$ulang = 20; | |
for ($i=0; $i < $ulang; $i++) { | |
// bikin kondisi angka ganjil | |
if ($i%2==1) { | |
// cetak spasi setengah dari total $ulang | |
for ($j=($ulang-$i)/2; $j >=0; $j--) { | |
echo $spc; | |
} | |
// baru cetak titiknya | |
for ($k=0; $k < $i; $k++) { | |
echo $a; | |
usleep(60000); | |
} | |
echo PHP_EOL; | |
} | |
} | |
// kalo total titiknya udah mentok maksimal dari ulang | |
// baru bikin kebalikan loopnya | |
for ($l=0; $l <= $ulang; $l++) { | |
if ($l%2==1) { | |
for ($m=0; $m < $l/2; $m++) { | |
echo $spc; | |
} | |
for ($n=($ulang-$l); $n > 0; $n--) { | |
echo $a; | |
usleep(60000); | |
} | |
echo PHP_EOL; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment