Skip to content

Instantly share code, notes, and snippets.

@guaracy
Created February 8, 2016 22:49
Show Gist options
  • Save guaracy/72b7d041c03ca3ece02c to your computer and use it in GitHub Desktop.
Save guaracy/72b7d041c03ca3ece02c to your computer and use it in GitHub Desktop.
var
max : integer = 99;
bottles : integer;
bottle_word : string;
begin
for bottles := max downto 1 do begin
if bottles = 1 then
bottle_word := 'bottle'
else
bottle_word := 'bottles';
if bottles <> max then begin
writeln('Take one down and pass it arround');
writeln(bottles, ' ', bottle_word, ' of beer on the wall.');
writeln;
end;
writeln(bottles, ' ', bottle_word, ' of beer on the wall');
writeln(bottles, ' ', bottle_word, ' of beer');
end;
writeln('Take one down and pass it arround');
writeln('No more bottles of beer on the wall.');
writeln;
writeln('Go to the store and buy some more');
writeln(max, ' bottles of beer on the wall.');
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment