The output reminds me of nethack.
A random dungeon generator that fits on a business card (2019)
21–30 of 53 posts
Re: A random dungeon generator that fits on a business card (2019)
#22Whenever I'd run an adventure, my players would often try me out, and open a door of some sorts. But the 2D maps feel very artificial. Guillaume Tavernier on Patreon makes maps with plateaus and multiple stories: https://www.patreon.com/dearchitecturart
A generator like that, would be awesome.
Re: A random dungeon generator that fits on a business card (2019)
#23Re: A random dungeon generator that fits on a business card (2019)
#24I've always been a fan of generating mazes by randomly printing /, \, or a space. It ends up slanted, and there's obviously no guarantees of solvability, but it's surprisingly good for how simple it is. Here's a bash version in 50 characters ( https://codegolf.stackexchange.com/a/26011/7934 ): w=(╱ ╲);while :;do echo -n ${w[RANDOM%2]};done and how it looks like: https://i.stack.imgur.com/fRX05.png
This is the modern equivalent of the classic Commodore BASIC 10 PRINT CHR$(205.5+RND(1)); : GOTO 10
I can't recommend it without reservation, but if you're curious what a whole book about one line of code is like, you can find out.
Re: A random dungeon generator that fits on a business card (2019)
#25https://gist.github.com/Joker-vD/cc5372a349559b9d1a3b220d5ea...
Pretty interesting reading this code. Also nice to see things written in C around here.
Re: A random dungeon generator that fits on a business card (2019)
#26I heard you like javascript so here you go: const H = 40; const W = 80; let m = new Array(H).fill().map(() => new Array(W).fill(" ")); function g(x) { return Math.floor(Math.random() * x); } function cave(s) { const w = g(10) + 5; const h = g(6) + 3; let t = g(W - w - 2) + 1; let u = g(H - h - 2) + 1; for (let y = u - 1; y t + w; const v = y u + h; if (s ^ v && m[y][x] === "#") { d++; if (g(d) === 0) { e = x; f = y;…
Re: A random dungeon generator that fits on a business card (2019)
#27[flagged]
But I find it noteworthy, and in fact impressive, that ChatGPT can de-obfuscate and discern the meaning of this code. Letting the rest of us know that is a worthy contribution to the discussion.
I would suggest leading with a clear statement of why you're posting chatbot output, though. Folks around here have an allergy to that sort of thing for a reason.
Re: A random dungeon generator that fits on a business card (2019)
#28Re: A random dungeon generator that fits on a business card (2019)
#29I heard you like javascript so here you go: const H = 40; const W = 80; let m = new Array(H).fill().map(() => new Array(W).fill(" ")); function g(x) { return Math.floor(Math.random() * x); } function cave(s) { const w = g(10) + 5; const h = g(6) + 3; let t = g(W - w - 2) + 1; let u = g(H - h - 2) + 1; for (let y = u - 1; y t + w; const v = y u + h; if (s ^ v && m[y][x] === "#") { d++; if (g(d) === 0) { e = x; f = y;…
(but also, thank you for sharing this!)