I hadn't looked at the stuff you had added from the previous error post to this one. Yes, every single line of code you added from x:32 to (x+1):02 (x depends on your time zone) is wrong, and cannot be made right.

Find a C++ book. Start on page 1. By the time you get to page 200 or so, this will all seem much easier.

You could compress your map data. I'm not suggesting anything radical, something simple like keeping track of alternating runs of 0 and 1, then write a function to populate the map from the data. So like your matrix data:

etc. (Note, I started with the assumption that the first bit would be 0. In this map that wasn't the case, so I had to start with a 0.)

This would effectively reduce the map in memory to a more manageable size. Treat the whole map like a single line and just be sure to wrap around your data structure appropriately. (By the way, this is a similar method used in the classic BASIC program LOVE.)

I recently came up with a more robust method of compression, but I don't think this program calls for that.