Wave Collapse Function: Practical Implementation Guide for Procedural Generation