Execute HQ9+: Difference between revisions

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