CodingTrain / CodingTrain/Wave-Function-Collapse
Encoding tiles symmetry and rotation
- Dominant language
- JavaScript
- Stars
- 218
- Forks
- 64
- PR merge metrics
- No merged PRs in 30d
Description
The base implementation notes that you can "Augment pattern data with rotations and reflections."
I don't think you need reflections for the circuit problem but you might run into it with more complex setup.
Let's assume you don't need reflections.
For rotations you need to have 4 letters that indicate the orientation of the piece.
For this issue let's call them :
- S -> straight
- L -> rotated 90° to the left
- F -> "flipped" but really it's rotated 180°
- R -> rotated 90° to the right
So this tile :

would have edges 4S, 2, 4S, 0
And this one :

would have : 4S, 1, 1, 4R
Now the complicated bit is that you have to account for that whenever you are rotating a piece.
For a Left (90°) rotation :
- every S becomes L
- every L becomes F
- every F becomes R
- every R becomes S
This also fixes the problem of having 5.png left edge connecting to a 4S the wrong way because it will never be a 4S AND a top facing edge at the same time.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the base implementation and tracing where tile pattern data is rotated. Encode the four orientations S, L, F, and R, and verify that rotating a piece updates each orientation consistently without adding reflections. Done means the described edge combinations remain correctly aligned after every rotation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100