Programmer / Web Developer

Newport News, VA

January 1996

Learn Unity/C#

Awesome Thoery Idle


This site is under construction. Don't mind the mess - maybe someday this will be worth reading!

Welcome to Derp...Derp...Code!, my programming journal/blog. This site is more for me than anyone else, but if you are here and reading, that's great! You might wonder about the name - I might be good at programming, but I am a bad programmer, so I tend to derp a lot before producing worthwhile code.

Avatar6 Mar 2019

Coding a random dungeon generator, pt 2

Going down the rabbit hole

Alright, please check out Part 1 if you haven't yet. Cool? Now we start moving on to an area where I am not 100% sure what I was thinking, but it works. It the previous article, we set up the dungeon and its parameters, so now it is time to actually build the thing one square at a time. I do this in a wonky way, probably quite suboptimal, but that is why there are two derps before I get to the code. I remember struggling with all of this quite a bit when I was originally writing it - some things just took a while to figure out.

for ($x = 1; $x <= 15; $x++) {

Tags: Awesome Theory code dungeon generator functions globals random