Josh Cooper
, , ,
No Comments

Normally a tile map displays spaces which can be defined in finite terms using a piece of paper. A hypermaze, however, can be defined using a piece of paper, only, if you use a graph to describe how the pieces fit together. This is true for my hypermaze, and I suspect it should hold true for most other hypermazes. A tile map is a lot like a piece of paper, only a lot less powerful; thus in relation to a tile map you should consider the space of hypermaze to be undefined. You can’t measure it, because it doesn’t have a concrete form in 2 dimensions. You might have success defining it in three dimensions, but then you’ll be unable to translate it to the tile map.

So how can a tile map be used to draw an undefined space?
The answer I found was: little by little.

Josh Cooper
, ,
No Comments

There you are designing a parallel algorithm, and then it occurs to you: How do I return information to the main thread from a child thread?

If you’ve skimmed through half of The C++ Programming Language (4th Edition) by Bjarne Stroustrup like I have, you may recall a section about futures and promises which are related to threads.

Well those are exactly what we need, although I am sure you could create a custom solution. Like perhaps locking and inserting your data into an external container. Perhaps you prefer a standard C++ answer to your problems though? This way it makes sense and you need less comments.

My case was that I wished to learn the “proper” way to do it, and boy did I have a time learning.

Josh Cooper
, , ,
No Comments

The problem is this: You have a two dimensional grid, and you need to scan the entire thing. Sure, but what does this ambiguous “scan” do? Well this particular post is about a word search puzzle, so the scans need to create strings to be used as search areas for the puzzle words. Scan the puzzle, and it compiles a list of all the columns, rows, and diagonals.

Now, there are a total of 8 directions you can scan a two dimensional grid by. { N, NE, E, SE, S, SW, W, NW – Exactly eight.} Wouldn’t it be nice if we didn’t need to scan all those directions. Well, if you think about it ‘E’ is a reflection of ‘W’ the same as ‘NE’ is a reflection of ‘SW’. Since the thing I just said, we don’t actually need to scan all 8 directions up front. We do need to look at all 8 directions, but we certainly don’t need to create strings for all 8.