I <i>love</i> 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.<p>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.
In case you wondered if there is a raycaster written in MS Batch:<p><a href="https://github.com/nTh0rn/batch-raycaster">https://github.com/nTh0rn/batch-raycaster</a>
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.
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.
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.
"bash is slow."<p>That's in part why I do not use it for scripting. I do not use it for interactive use either.<p>Some popular Linux distributions also avoid bash as a scripting shell.
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.<p>Seriously though, this is really cool
Of course, we need to give an honorable mention to the `awk` raycaster from 9 years ago.<p><a href="https://github.com/TheMozg/awk-raycaster/tree/master">https://github.com/TheMozg/awk-raycaster/tree/master</a>
Beautiful. Correct me if I'm wrong, but this looks like a bash version of <a href="https://lodev.org/cgtutor/raycasting.html" rel="nofollow">https://lodev.org/cgtutor/raycasting.html</a><p>Edit: ah, just noticed this is in the readme :(
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?