Thanks very much for this. I used it to learn how to use arrays in Construct2 (they made my head hurt initially), and i've now turned it into a decent terraria lite demo.
I've got multiple block types (gold etc), placeable ladders, placeable blocks, grass that regrows over time based on certain rules, realtime lighting, etc. I got very inspired lol. Learned so much from your code. Wasn't aware of the bit technique for tile selection, thanks again. :)