The algorithm that generates game maps, writing a tune. Every step begins as a superposition of all scale degrees; your rules knock candidates out. The solver repeatedly collapses the most-decided step to one remaining possibility and propagates the consequences in both directions — the end of the melody constrains the beginning. No probabilities, no training: just rules, and whatever freedom they leave. If the rules contradict each other, it restarts; if they're impossible, it says so.
press “collapse” to solve a melody from the rules