I'm getting "A crash inside the runtime has been intercepted!" message and since I'd like to hear some tips and tricks on the topic I thought a new thread could work.
I thought I'd post some pictures instead of thousands of words!

This is what I have:


This is what I'm trying to get:

I hope you get the idea

This is my first time doing procedural generation and also my first time using both Array and Hash table objects. Please be gentle!
Edit: Forgot to mention that my intention is to use the data in my array for creating each tile in my level later on. Am I heading the right way?