99 Bottles of Beer/Pascal: Difference between revisions
Content added Content deleted
(moving code from main task-page to sub-page / Component Pascal) |
(moving code from main task-page to sub-page) |
||
Line 62: | Line 62: | ||
0 bottles of beer on the wall. |
0 bottles of beer on the wall. |
||
</pre> |
</pre> |
||
=={{header|Delphi}}== |
|||
:''See [[#Pascal|Pascal]]'' |
|||
:''Or |
|||
<lang Delphi>program Hundred_Bottles; |
|||
{$APPTYPE CONSOLE} |
|||
uses SysUtils; |
|||
const C_1_Down = 'Take one down, pass it around' ; |
|||
Var i : Integer ; |
|||
// As requested, some fun : examples of Delphi basic techniques. Just to make it a bit complex |
|||
procedure WriteABottle( BottleNr : Integer ) ; |
|||
begin |
|||
Writeln(BottleNr, ' bottles of beer on the wall' ) ; |
|||
end ; |
|||
begin |
|||
for i := 99 Downto 1 do begin |
|||
WriteABottle(i); |
|||
Writeln( Format('%d bottles of beer' , [i] ) ) ; |
|||
Writeln( C_1_Down ) ; |
|||
WriteABottle(i-1); |
|||
Writeln ; |
|||
End ; |
|||
end.</lang> |
|||