by purplesyringa on 12/21/24, 7:06 AM
I
love this. I've been wondering how the picture is drawn with less than one `echo` per pixel, and it's very clever: the game is "not really" 3D, so you can run raytracing just once per column, and then you only need to draw a couple of lines (for sky, grass, and the actual object) -- this is done by outputting the "draw this pixel and move down by one" string to the terminal as many times as necessary using string repetition.
I've been considering working on a voxel render engine (not for Bash, but for another computationally limited environment). This is a treasure, I'm certain I'll find something useful here.
by tdeck on 12/21/24, 3:06 AM
by Arch-TK on 12/20/24, 11:05 PM
It's unfortunate that stty requires forking. Maybe the next project will be to use bash and rowhammer to call the necessary ioctls to do it without forking.
by alsetmusic on 12/21/24, 1:30 AM
I had no idea this was possible with Bash. I’ve considered myself proficient with Bash at a pretty advanced level at times and this just blows me away. I don’t have the math chops to understand how it’s implemented, but it’s a pleasure to see.
by einpoklum on 12/21/24, 12:38 AM
And to think, that my own bash scripts spend 300 lines just parsing various command-line options, while instead I could be showing this game... :-P
by 8n4vidtmkvmk on 12/21/24, 7:31 AM
I never ceases to baffle me how we're still stuck with these mind bogglingly slow shells. Pure madness. I can maybe understand that some apps require all the vt100 weirdness or whatever, but probably 90% of apps just write to stdout and err. Surely we can blit some text to the screen a bit quicker and put the other 10% into some compat mode.
by markeroon on 12/20/24, 11:08 PM
Only 300 lines of code, impressive! I love this.
by 1vuio0pswjnm7 on 12/21/24, 9:51 PM
"bash is slow."
That's in part why I do not use it for scripting. I do not use it for interactive use either.
Some popular Linux distributions also avoid bash as a scripting shell.
by Teongot on 12/20/24, 11:02 PM
I'd love to see this combined with the author's fork()-less implementation of ps to make a (almost) fork()-free implementation of psDoom.
Seriously though, this is really cool
by mmh0000 on 12/21/24, 6:03 PM
by shric on 12/21/24, 12:41 AM
by anfractuosity on 12/21/24, 12:39 PM
Very cool! I'm curious when it says "did you know that accessing a random element in an array takes linear time", why that's the case, with bash?
by armSixtyFour on 12/21/24, 7:28 PM
Sadly I can't get this working. It just throws up the view into a file called buffered for whatever reason and exits immediately :(
by mlconnor on 12/21/24, 7:15 PM
Wow, that’s an insane challenge. I can’t believe that’s even possible.
by CaesarA on 12/21/24, 1:12 AM
I wonder if texture mapping this would look good.
by corytheboyd on 12/21/24, 1:17 AM
Imagine a TUI where you need to navigate a literal maze of options
by ormaaj on 12/21/24, 12:43 PM
<3