logoalt Hacker News

thih9yesterday at 6:14 PM1 replyview on HN

> 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

[2]: https://en.wikipedia.org/wiki/Mahjong_solitaire#/media/File:...


Replies

Crestwavetoday at 12:50 AM

A "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.