4 ms·
Was going to send this to them, but they requested serious attempts only, so here you go HN: WSA: push 10 push 97 push 106 push 110 push 105 push
by swolchok 17y ago
Was going to send this to them, but they requested serious attempts only, so here you go HN:
WSA:
push 10
push 97
push 106
push 110
push 105
push 78
push 32
push 111
push 108
dup
push 101
push 72
push 11
label 100
swap
outchar
push 1
sub
dup
jn 200
jump 100
label 200
exit
Whitespace is actually a really easy-to-code-for stack machine, you just need an assembler. Now you too can pretend to be elite.
EDIT: post originally included the compiled Whitespace code, but HN does not approve of that. Fixed the line break problem, thanks to someone reminding me it needs a blank line before and after.
- edw519 17y ago"It also doesn't approve of line breaks." Indent each line 2 spaces, format it however you want, and resubmit.
- troels 17y agoHere's mine: Hello World It's valid PHP, and it prints "Hello World".
- aarongough 17y agoI find the whole idea quite amusing... Reminds me a little of the demo scene back in the day. I put this together with that in mind, simple but I wanted to keep the code neat (JavaScript): EDIT: Realized I should add an online preview, the animation starts 6 seconds after the page loads... http://aarongough.com/hello_world.html http://aarongough.com/hello_world.html function floatPixel ( pixelFilled, pixelSize ) { this.render = function () { if( thisObj.pixelFilled ) thisObj.pixel.style.background = "black"; if( !thisObj.pixelFilled ) thisObj.pixel.style.background = "white"; } this.animate = function() { thisObj.pixelFilled = true; thisObj.render(); } var thisObj = this; this.pixelFilled = pixelFilled; this.pixelSize = pixelSize; this.pixel = document.createElement("div"); this.pixel.style.height = this.pixelSize + "px"; this.pixel.style.width = this.pixelSize + "px"; this.pixel.style.cssFloat = "left"; this.render(); this.timer = setTimeout( this.animate, Math.floor( Math.random() * 15000 + 6000 )); document.getElementById("pixel_container").appendChild( this.pixel ); } document.body.style.background = "black"; document.body.style.textAlign = "center"; var pixelContainer = document.createElement("div"); pixelContainer.id = "pixel_container"; pixelContainer.style.height = "50px"; pixelContainer.style.width = "900px"; pixelContainer.style.margin = "200px auto"; pixelContainer.style.position = "relative"; document.body.appendChild( pixelContainer ); var pixelData = "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000100011111000100000001000000011111000000100010001111100011110000100000001110000010000000000000000100010001000000010000000100000001000100000010001000100010001000100010000000100100001000000000000000011111000111110001000000010000000100010000001000100010001000111100001000000010001000100000000000000001000100010000000100000001000000010001000000101010001000100010001000100000001001000000000000000000000100010001111100011111000111110001111100000011011000111110001000100011111000111000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; for( x = 0; x < pixelData.length; x++ ) { new floatPixel( parseInt(pixelData.slice(x, x + 1)), 9 ); }