This is a "Wang 2" tile map generator that I've been working on with @Locomule, with a critical component (hash function) added by @DadOfMrLog. Now we have the logic looking good, can we get the scrolling speed up? https://scratch.mit.edu/discuss/topic/224607/
I've kept the source as simple as I can. It's only about 1 page of code. There's a bit of an explanation as to how it works at https://scratch.mit.edu/discuss/topic/224537/ This lets you create large maps without requiring an array to hold any data. There is a more complex version which limits the dimensions of the map at https://scratch.mit.edu/projects/129232814/