3 ms·
> Tiles are supposed to be free when there is a side free No. According to wikipedia[1]: "A tile is said to be open or exposed if it can be moved either left
by thih9 8mo ago
> Tiles are supposed to be free when there is a side free
No.
According to wikipedia[1]: "A tile is said to be open or exposed if it can be moved either left or right without disturbing other tiles.". Also look at the photo in the wikipedia article[2]. This implementation looks correct to me.
[1]: https://en.wikipedia.org/wiki/Mahjong_solitaire https://en.wikipedia.org/wiki/Mahjong_solitaire
[2]: https://en.wikipedia.org/wiki/Mahjong_solitaire#/media/File:Mahjong_solitaire-02.jpg https://en.wikipedia.org/wiki/Mahjong_solitaire#/media/File:...
- Crestwave 8mo agoA "free side" means being exposed on the left or right, matching your Wikipedia quote. On the other hand, OP's implementation checks if it can be moved up or down.
- thih9 8mo agoLook at the shape of the puzzle and compare with the wikipedia photo. The sides logic is correct. Although looks like the images on the tiles were indeed rotated, as mentioned in another comment[1]. [1]: https://news.ycombinator.com/item?id=47115499 https://news.ycombinator.com/item?id=47115499