Execute HQ9+: Difference between revisions
Content added Content deleted
m (moved RCHQ9+ to Execute HQ9+) |
(J) |
||
Line 12: | Line 12: | ||
See [[RCHQ9+/Haskell]]. |
See [[RCHQ9+/Haskell]]. |
||
=={{header|J}}== |
|||
From [[99_Bottles_of_Beer#J|99 Bottles of Beer]] |
|||
<lang J>bob =: ": , ' bottle' , (1 = ]) }. 's of beer'"_ |
|||
bobw=: bob , ' on the wall'"_ |
|||
beer=: bobw , ', ' , bob , '; take one down and pass it around, ' , bobw@<:</lang> |
|||
The rest of the interpreter: |
|||
<lang J>H=: smoutput bind 'Hello, world!' |
|||
Q=: smoutput @ [ |
|||
hq9=: smoutput @ beer"0 bind (1+i.-99) |
|||
hqp=: (i. 0 0) + 1: |
|||
hq9p=: H`H`Q`Q`hq9`hqp@.('HhQq9+' i. ])"_ 0~</lang> |
|||
Example use: |
|||
<lang J> hq9p 'hqQQq' |
|||
Hello, world! |
|||
hqQQq |
|||
hqQQq |
|||
hqQQq |
|||
hqQQq</lang> |
|||
=={{header|Java}}== |
=={{header|Java}}== |