99 Bottles of Beer/Pascal: Difference between revisions

m
Fixed syntax highlighting.
m (→‎{{header|Pascal}}: oops, forgot a writeln at the end of the verse)
m (Fixed syntax highlighting.)
 
(3 intermediate revisions by 2 users not shown)
Line 1:
<!--
===Pascal===
-->
{{collection|99 Bottles of Beer}}
Line 6:
__toc__
 
<!--
See [[99 Bottles of Beer/Pascal]]
-->
 
<span style='font-family: "Linux Libertine",Georgia,Times,serif;font-size:150%;'>[[Component Pascal]]</span><hr>
=={{header|Component Pascal}}==
BlackBox Component Builder
<langsyntaxhighlight lang="oberon2">
MODULE BottlesOfBeer;
IMPORT StdLog;
Line 35 ⟶ 32:
END Sing;
END BottlesOfBeer.
</syntaxhighlight>
</lang>
Execute: ^Q BottlesOfBeer.Sing<br/>
Output:
Line 64 ⟶ 61:
 
 
<span style='font-family: "Linux Libertine",Georgia,Times,serif;font-size:150%;'>[[Delphi]]</span><hr>
=={{header|Delphi}}==
:''See [[#Pascal|Pascal]]''
 
:''Or
 
<langsyntaxhighlight Delphilang="delphi">program Hundred_Bottles;
 
{$APPTYPE CONSOLE}
Line 95 ⟶ 92:
End ;
 
end.</langsyntaxhighlight>
 
 
<span style='font-family: "Linux Libertine",Georgia,Times,serif;font-size:150%;'>[[Pascal]]</span><hr>
=={{header|Pascal}}==
<langsyntaxhighlight lang="pascal">program BottlesOfBeer;
 
var
i: Integerinteger;
 
begin
for i := 99 downto 1 do
if i =<> 1 then begin
writeln('One bottle of beer on the wall');begin
writeln(i, 'One bottlebottles of beer on the wall');
writeln('Take one down writeln(i, pass' bottles itof aroundbeer');
writeln('No more bottlesTake ofone beerdown, onpass theit wallaround');
end else begin if i = 2 then
writeln(i, 'One bottlesbottle of beer on the wall');
writeln(i, ' bottles of beer');else
writeln('Takei one- down1, pass' bottles of beer on itthe aroundwall');
if i = 2 thenwriteln;
writeln('One bottle of beer on the wall')end
else
end; begin
writeln(i - 1, ' bottles of beer on the wall')
writeln('One bottle of beer on the wall');
writeln('One bottle of beer');
end;
writeln('Take one down, pass it around');
end. </lang>
writeln(i'No - 1, 'more bottles of beer on the wall');
end
end.</syntaxhighlight>
9,476

edits