99 bottles of beer: Difference between revisions
Content added Content deleted
(added Chapel) |
|||
Line 3,426: | Line 3,426: | ||
}</lang> |
}</lang> |
||
Correct grammar and nice |
Correct grammar and nice spacing in modern perl: |
||
<lang perl>use 5.10.0; |
|||
<lang perl>my $num = 99; #starting bottle count |
|||
for (0..98) { #times going through |
|||
$num = 99; |
|||
⚫ | |||
while ($num > 0) { |
|||
⚫ | |||
⚫ | |||
print "$num bottle$s of beer\n"; |
|||
⚫ | |||
⚫ | |||
$num--; |
$num--; |
||
my $s = "s" unless ($num == 1); |
my $s = "s" unless ($num == 1); |
||
$num = "No more" if ($num == 0); |
|||
⚫ | |||
if ($num != 0) { #useless spacing trick |
|||
} |
|||
print "\n"; |
|||
} |
|||
say "No more bottles of beer on the wall, no more bottles of beer."; |
|||
}</lang> |
|||
say "Go to the store and buy some more, 99 bottles of beer on the wall.";</lang> |
|||
=={{header|Perl 6}}== |
=={{header|Perl 6}}== |