forked from Ishaan28malik/Hacktoberfest-2024
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Ishaan28malik#1487 from boamidiotic/master
Create Pyramid.php
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
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
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 | ||
*/ |