Execute HQ9+/Ursala: Difference between revisions
Content added Content deleted
(created) |
(added Ursala) |
||
Line 1: | Line 1: | ||
{{collection|RCHQ9+}}{{implementation|HQ9+}}[[Category:Python]] |
{{collection|RCHQ9+}}{{implementation|HQ9+}}[[Category:Python]] |
||
Unrecognized operators or a missing input file cause diagnostic messages. |
|||
Since the accumulator is unreadable and has no operational consequences, |
|||
its value isn't stored. A line break at the end of the file, if any, is ignored. |
|||
=={{header|Ursala}}== |
|||
<lang Ursala> |
|||
#import std |
|||
#import nat |
|||
quantity = ~&iNC+ --' of beer'+ ~&?( |
|||
1?=/'1 bottle'! --' bottles'+ ~&h+ %nP, |
|||
'no more bottles'!) |
|||
verse = |
|||
^(successor,~&); ("s","n"). -[ |
|||
-[quantity "s"]- on the wall, -[quantity "s"]-, |
|||
Take one down and pass it around, -[quantity "n"]- on the wall.]- |
|||
refrain "n" = |
|||
-[ |
|||
No more bottles of beer on the wall, -[quantity 0]-. |
|||
Go to the store and buy some more, -[quantity "n"]- on the wall.]- |
|||
whole_song "n" = ~&ittt2BSSL (verse*x iota "n")--<refrain "n"> |
|||
#executable ('parameterized','') |
|||
rchq = |
|||
<.file$[contents: --<''>]>+ -+ |
|||
*= case~&r ( |
|||
{`h: -[Hello, World!]-!,`9: whole_song99!,`+: <>!,`q: ~&l}, |
|||
% <.'unrecognized operator: '--+ ~&rNC>), |
|||
~command.files; ~&itZB?/~&h.contents.&ziyQLD <'usage: rchq [file]'>!%+- |
|||
</lang> |
Revision as of 21:24, 12 August 2009
Execute HQ9+/Ursala is part of RCHQ9+. You may find other members of RCHQ9+ at Category:RCHQ9+.
Execute HQ9+/Ursala is an implementation of HQ9+.
Other implementations of HQ9+.
Unrecognized operators or a missing input file cause diagnostic messages. Since the accumulator is unreadable and has no operational consequences, its value isn't stored. A line break at the end of the file, if any, is ignored.
Ursala
<lang Ursala>
- import std
- import nat
quantity = ~&iNC+ --' of beer'+ ~&?(
1?=/'1 bottle'! --' bottles'+ ~&h+ %nP, 'no more bottles'!)
verse =
^(successor,~&); ("s","n"). -[
-[quantity "s"]- on the wall, -[quantity "s"]-, Take one down and pass it around, -[quantity "n"]- on the wall.]-
refrain "n" =
-[
No more bottles of beer on the wall, -[quantity 0]-. Go to the store and buy some more, -[quantity "n"]- on the wall.]-
whole_song "n" = ~&ittt2BSSL (verse*x iota "n")--<refrain "n">
- executable ('parameterized',)
rchq =
<.file$[contents: --<>]>+ -+
*= case~&r ( {`h: -[Hello, World!]-!,`9: whole_song99!,`+: <>!,`q: ~&l}, % <.'unrecognized operator: '--+ ~&rNC>), ~command.files; ~&itZB?/~&h.contents.&ziyQLD <'usage: rchq [file]'>!%+-
</lang>