99 Bottles of Beer/Pascal: Difference between revisions

→‎{{header|Pascal}}: Modified so that it's a stand-alone program, and eliminated "Format" since not all Pascals support that. Simplified code a little bit.
(moving code from main task-page to sub-page)
(→‎{{header|Pascal}}: Modified so that it's a stand-alone program, and eliminated "Format" since not all Pascals support that. Simplified code a little bit.)
Line 99:
 
=={{header|Pascal}}==
<lang pascal>procedureprogram BottlesOfBeer;
var
i: Integer;
begin
for i := 99 downto 1 do
if i = 1 then begin
WriteLn(Format writeln('%dOne bottlesbottle of beer on the wall', [i]));
if i = 1 then
writeln('One bottle of beer');
begin
WriteLn writeln('1 bottleTake ofone beerdown, onpass theit wallaround');
WriteLn writeln('1No bottlemore bottles of beer on the wall');
WriteLn('Take one down,end passelse it around');begin
WriteLn writeln('Noi, more' bottles of beer on the wall');
writeln(i, ' bottles of beer');
Exit;
WriteLn writeln('Take one down, pass it around');
end;
if i = 12 then
WriteLn(Format('%d bottles of beer on the wall', [i]));
WriteLn(Format writeln('%dOne bottlesbottle of beer', [i])on the wall');
else
WriteLn('Take one down, pass it around');
WriteLn(Format writeln(i - 1, '%d bottles of beer on the wall', [Pred(i)]));
WriteLn('') end;
end;. </lang>
end;
end;</lang>