3 ms·
It is a nice UX, but with a fatal flaw: Tiles are supposed to be free when there is a side free, but you instead have it coded to be free when the top or bottom
by codingdave 7mo ago
It is a nice UX, but with a fatal flaw: Tiles are supposed to be free when there is a side free, but you instead have it coded to be free when the top or bottom is free. Your app, your rules, so if you intended to do that, cool. It is just a fundamental divergence from how other implementations do it.
- rpdillon 7mo agoThanks for mentioning this. I played a little bit and I felt like it was the opposite of what I'd remembered. I do like that the inaccessible tiles are faded somewhat so that I don't inadvertently try to match them.
- deleted 7mo ago[deleted]
- rofko 7mo agoThank you for the feedback! I will triple check the rules
- thih9 7mo 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 7mo 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 7mo 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
- jasperry 7mo agoIf you rotate it so the board looks like the traditional solitaire layout, the direction of free tiles is horizontal as it's supposed to be. But then the images on the tiles are rotated 90 degrees. Either way you look at it, something is non-standard. The other thing is that this implementation doesn't seem to support overlapping tiles, which is kind of important. For instance, the topmost tile should overlap and block all four tiles under it.
- rofko 7mo agoThank you for the insight! I think rotating the tile images is key. Since I’m using CSS Grid for positioning, there are some limitations around overlap like the one you mentioned, but it should be solvable. I’ll keep working on it to bring it closer to the standard behavior.
- omgmajk 7mo agoTwo games in a row now I have gotten to a point where the last two pieces are ontop of eachother. I think this is perfectly fine, but seems to happen a little too often. Or I was just very unlucky. Otherwise it's a sweet game!
- rofko 7mo agoThank you! I'm going to review that. In the meantime I've added Undo/Redo options so you can backtrack your steps.