Skip to content

Commit

Permalink
Added Baklava in Perl
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaKateryna authored and Parker Johansen committed Oct 23, 2019
1 parent 8ebd795 commit 88f9363
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions archive/p/perl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Welcome to Sample Programs in Perl!

## Sample Programs

- [Baklava in Perl][8]
- [Capitalize in Perl](capitalize.pl)
- [Even/Odd in Perl](even-odd.pl)
- [Factorial in Perl](factorial.pl)
Expand Down Expand Up @@ -32,4 +33,5 @@ Welcome to Sample Programs in Perl!
[5]: https://www.perl.org
[6]: https://www.jdoodle.com/execute-perl-online
[7]: https://github.com/TheRenegadeCoder/sample-programs/issues/1501
[8]: https://github.com/TheRenegadeCoder/sample-programs/issues/1511

13 changes: 13 additions & 0 deletions archive/p/perl/baklava.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env perl
use strict;
use warnings;

my $size = 10;

for my $i (1..$size){
print " "x($size + 1 - $i), "*"x($i*2 - 1), "\n";
}

for my $j (0..$size){
print " "x($j), "*"x($size*2 - $j*2 + 1), "\n";
}

0 comments on commit 88f9363

Please sign in to comment.