Execute HQ9+: Difference between revisions
Content added Content deleted
(→{{header|REXX}}: added comments and seperator lines to program. -- ~~~~) |
|||
Line 716: | Line 716: | ||
=={{header|REXX}}== |
=={{header|REXX}}== |
||
⚫ | |||
<lang rexx> |
|||
⚫ | |||
do instructions=1 for length(pgm) |
do instructions=1 for length(pgm) |
||
Line 732: | Line 731: | ||
end /*instructions*/ |
end /*instructions*/ |
||
exit |
exit |
||
/*─────────────────────────────────────99 subroutine────────────────────*/ |
|||
99: do j=99 by -1 to 1 |
99: do j=99 by -1 to 1 |
||
say j 'bottle's(j) "of beer the wall," |
say j 'bottle's(j) "of beer the wall," |
||
Line 747: | Line 746: | ||
say '99 bottles of beer on the wall.' |
say '99 bottles of beer on the wall.' |
||
return |
return |
||
/*─────────────────────────────────────S subroutine─────────────────────*/ |
|||
s: if arg(1)=1 then return ''; return 's' |
s: if arg(1)=1 then return ''; return 's' /*a simple pluralizer.*/</lang> |
||
⚫ | |||
</lang> |
|||
⚫ | |||
<br><br> |
|||
H+Q |
|||
<pre style="height:40ex;overflow:scroll"> |
<pre style="height:40ex;overflow:scroll"> |
||
hello, world |
hello, world |
||
/*the HQ9+ language.*/ parse arg pgm . |
/*REXX program to implement the HQ9+ language.*/ parse arg pgm . |
||
do instructions=1 for length(pgm) |
do instructions=1 for length(pgm) |
||
Line 770: | Line 766: | ||
end /*instructions*/ |
end /*instructions*/ |
||
exit |
exit |
||
/*─────────────────────────────────────99 subroutine────────────────────*/ |
|||
99: do j=99 by -1 to 1 |
99: do j=99 by -1 to 1 |
||
say j 'bottle's(j) "of beer the wall," |
say j 'bottle's(j) "of beer the wall," |
||
Line 785: | Line 781: | ||
say '99 bottles of beer on the wall.' |
say '99 bottles of beer on the wall.' |
||
return |
return |
||
/*─────────────────────────────────────S subroutine─────────────────────*/ |
|||
s: if arg(1)=1 then return ''; return 's' |
s: if arg(1)=1 then return ''; return 's' /*a simple pluralizer.*/ |
||
</pre> |
</pre> |
||