Skip to content

Commit

Permalink
Merge pull request Ishaan28malik#1487 from boamidiotic/master
Browse files Browse the repository at this point in the history
Create Pyramid.php
  • Loading branch information
Ishaan28malik authored Nov 2, 2020
2 parents d056f41 + c178ff3 commit 676b895
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Mini-Projects/PHP/Pyramid.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
echo "\t\tHacktober Fest 2020\n";
for($i = 1; $i <= 25; $i ++) {
$hack = array(0,"H",0,"A",0,"C",0,"K",0,"T",0,"O",0,"B",0,"E",0,"R",0,"F",0,"E",0,"S",0,"T");
if (!($i % 2) && $i != 1)
continue;
print str_pad(str_repeat($hack[$i], $i),(50 - 1) * strlen($hack[$i]), " " , STR_PAD_BOTH);
print PHP_EOL;
}

/*
H
AAA
CCCCC
KKKKKKK
TTTTTTTTT
OOOOOOOOOOO
BBBBBBBBBBBBB
EEEEEEEEEEEEEEE
RRRRRRRRRRRRRRRRR
FFFFFFFFFFFFFFFFFFF
EEEEEEEEEEEEEEEEEEEEE
SSSSSSSSSSSSSSSSSSSSSSS
TTTTTTTTTTTTTTTTTTTTTTTTT
*/

0 comments on commit 676b895

Please sign in to comment.