RosettaCodeData/Task/Execute-HQ9+/11l/execute-hq9+.11l
2023-07-01 13:44:08 -04:00

49 lines
1.2 KiB
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

F hello()
print(Hello, world!)
String src
F quine()
print(:src)
F bottles()
L(i) (99.<2).step(-1)
print(#. bottles of beer on the wall.format(i))
print(#. bottles of beer.format(i))
print(Take one down, pass it around)
print(#. bottles of beer on the wall.format(i - 1))
print()
print(2 bottles of beer on the wall)
print(2 bottles of beer)
print(Take one down, pass it around)
print(1 bottle of beer on the wall)
print()
print(1 bottle of beer on the wall)
print(1 bottle of beer)
print(Take one down, pass it around)
print(No more bottles of beer on the wall)
print()
print(No more bottles of beer on the wall)
print(No more bottles of beer on the wall)
print(Go to the store and buy some more)
print(99 bottles of beer on the wall.)
print()
V acc = 0
F incr()
:acc++
:start:
src = File(:argv[1]).read()
[Char = (() -> N)] dispatch
dispatch[Char(h)] = hello
dispatch[Char(q)] = quine
dispatch[Char(9)] = bottles
dispatch[Char(+)] = incr
L(i) src.lowercase()
I i C dispatch
dispatch[i]()