From 676addbf62939c6ff0e0e22ba9727e8520bfedc6 Mon Sep 17 00:00:00 2001 From: Edvin Jakobsson Date: Tue, 8 Sep 2026 19:34:30 +0200 Subject: Add README --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..d55cab7 --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# ndoom + +An experiment in seeing how far a shell script can be pushed: a Wolfenstein-style raycaster written entirely in zsh, doing its trigonometry through `bc -l` and rendering the result as ASCII art in the terminal. + +`ndoom.sh` casts 91 rays across a fixed 8x8 hardcoded map, walking each one out step by step and writing its hit distance to a plain file called `distances`. `render.sh` reads that file back and draws one ASCII frame from it — closer walls as `#`, a floor tint below a `height` line, and blank sky above it. It's a single-frame renderer rather than a live game: the loop that would tie the two scripts together into an actual playable frame-by-frame walk is written but commented out in `ndoom.sh`, so right now it's run as two separate steps by hand. + +Mostly just curious to see whether shell arithmetic and `bc` could stand in for the floating-point trig a raycaster needs — turns out yes, just very, very slowly. + +## Running + +```sh +./ndoom.sh # casts rays, writes ./distances +./render.sh # reads ./distances, draws one ASCII frame +``` + +Needs `zsh` and `bc`. -- cgit v1.2.3