ombinations just don't work.
Only 47 do.</p>

<p>This kind of join can be used for most items: Walls, terrain, water.</p>

<p>To reduce a set of bit flags to a valid 47-state form, use this formula:
<blockquote><code>flags &amp;= ((flags &lt;&lt; 1) &amp; ((flags &lt;&lt; 7) | (flags &gt;&gt; 1))) | 85</code></blockquote></p>

<a name=161></a><h3>161-state joining</h3>

<p>161-state "incomplete corner" joining is unique but of limited
practicality for most games. It's a hybrid between 47-state and 256-state