From Esolang
(Redirected from H9)
Jump to navigation Jump to search

H9+ is HQ9+ with two differences: there is no "Q" instruction, and all characters that are not H, h, 9 or + are explicitly ignored. "hello, world" is therefore a quine.


Written in ES6 JavaScript. 288 bytes. Pass the code, don't pass a.

var hqplus=(c,a=0)=>c.map(h=>{(h=="H"||h=="h")&&alert("hello, world");h=="9"&&(()=>{for(x=99,z=(a=' on the wall')=>`${x||99} bottle${1-x?'s':''} of beer`+a;x;)alert(z()+', '+z`.`+(--x?'Take one down and pass it around, ':'Go to the store and buy some more, ')+z()+'.')})();h=="+"&&a++;});