Execute HQ9+/Java: Difference between revisions
Content added Content deleted
m (Lowercase-ing input) |
m (Spaces so "break" is highlighted) |
||
Line 20: | Line 20: | ||
for(char instr:code.toCharArray()){ |
for(char instr:code.toCharArray()){ |
||
switch(instr){ |
switch(instr){ |
||
case 'q': System.out.println(code);break; |
case 'q': System.out.println(code); break; |
||
case 'h': System.out.println("Hello, World!");break; |
case 'h': System.out.println("Hello, World!"); break; |
||
case '9': printBottles();break; |
case '9': printBottles(); break; |
||
case '+': acc++;break; |
case '+': acc++; break; |
||
default: //ignore other chars |
default: //ignore other chars |
||
} |
} |