[flagged]
One of the comments has the unobfuscated and commented version: https://gist.github.com/Joker-vD/cc5372a349559b9d1a3b220d5ea...
A random dungeon generator that fits on a business card (2019)
11–20 of 53 posts
Re: A random dungeon generator that fits on a business card (2019)
#12Here'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:Re: A random dungeon generator that fits on a business card (2019)
#13I'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
Re: A random dungeon generator that fits on a business card (2019)
#14I'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
Re: A random dungeon generator that fits on a business card (2019)
#15Earlier quoted context omitted.
In what way is what ChatGPT outputs when asked about this code relevant? There are more than 20 LLMs, do we expect to see a comment from each LLM about code submissions?
I'm not proficient at reading minimized code. Maybe you're better at it than I am. The ChatGPT output helps kickstart a meaningful discussion about the content of the code.
From an outside observer it just seems like you wanted ChatGPT to contribute on your behalf, not start a discussion of the code.
Re: A random dungeon generator that fits on a business card (2019)
#16I'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
Surprisingly good for what purpose?
Re: A random dungeon generator that fits on a business card (2019)
#17I'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
Re: A random dungeon generator that fits on a business card (2019)
#18Earlier quoted context omitted.
I'm not proficient at reading minimized code. Maybe you're better at it than I am. The ChatGPT output helps kickstart a meaningful discussion about the content of the code.
It would probably help if you included that context in the beginning of the comment. Not just dumping ChatGPT output. From an outside observer it just seems like you wanted ChatGPT to contribute on your behalf, not start a discussion of the code.
Re: A random dungeon generator that fits on a business card (2019)
#19const 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;
}
}
}
}
if (d === 0) return;
}
for (let y = u - 1; y t + w;
const v = y u + h;
m[y][x] = s && v ? "!" : s ^ v ? "#" : ".";
}
}
if (d > 0) m[f][e] = g(2) ? "'" : "+";
for (let j = 0; j
}function main() { for (let y = 0; y
for (let j = 0; j
}main();
Re: A random dungeon generator that fits on a business card (2019)
#20I'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
10 PRINT CHR$(205.5+RND(1)); : GOTO 10