Execute HQ9+/Python: Difference between revisions
Content added Content deleted
No edit summary |
(added + operator) |
||
Line 1: | Line 1: | ||
{{collection|RCHQ9+}} |
{{collection|RCHQ9+}} |
||
This example implements |
This example implements 'H', 'Q', '9' and '+'. |
||
The author does not explains what '+' exactly do. I just increased a "acc" variable. |
|||
<lang python>import sys |
<lang python>import sys |
||
Line 49: | Line 51: | ||
sys.exit(1) |
sys.exit(1) |
||
acc = 0 |
|||
src = s.read() |
src = s.read() |
||
Line 58: | Line 61: | ||
elif i == '9': |
elif i == '9': |
||
bottles() |
bottles() |
||
elif i == '+': |
|||
acc += 1 # ? |
|||
else: |
else: |
||
pass # |
pass # It's a comment, ignore it.</lang> |
||
</lang> |