Execute HQ9+: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (Fix Perl 6 -> Raku links) |
MaiconSoft (talk | contribs) No edit summary |
||
Line 564: | Line 564: | ||
} |
} |
||
}</lang> |
}</lang> |
||
=={{header|Delphi}}== |
|||
{{libheader| System.SysUtils}} |
|||
{{Trans|C}} |
|||
<lang Delphi> |
|||
uses |
|||
System.SysUtils; |
|||
procedure runCode(code: string); |
|||
var |
|||
c_len, i, bottles: Integer; |
|||
accumulator: Cardinal; |
|||
begin |
|||
c_len := Length(code); |
|||
accumulator := 0; |
|||
for i := 1 to c_len do |
|||
begin |
|||
case code[i] of |
|||
'Q': |
|||
writeln(code); |
|||
'H': |
|||
Writeln('Hello, world!'); |
|||
'9': |
|||
begin |
|||
bottles := 99; |
|||
repeat |
|||
writeln(format('%d bottles of beer on the wall', [bottles])); |
|||
writeln(format('%d bottles of beer', [bottles])); |
|||
Writeln('Take one down, pass it around'); |
|||
dec(bottles); |
|||
writeln(format('%d bottles of beer on the wall' + sLineBreak, [bottles])); |
|||
until (bottles <= 0); |
|||
end; |
|||
'+': |
|||
inc(accumulator); |
|||
end; |
|||
end; |
|||
end;</lang> |
|||
=={{header|DWScript}}== |
=={{header|DWScript}}== |