19 comments

  • codingdave7 hours 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.
    • jasperry1 hour ago
      If you rotate it so the board looks like the traditional solitaire layout, the direction of free tiles is horizontal as it&#x27;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.<p>The other thing is that this implementation doesn&#x27;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.
      • rofko48 minutes ago
        Thank 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.
    • rpdillon7 hours ago
      Thanks for mentioning this. I played a little bit and I felt like it was the opposite of what I&#x27;d remembered. I do like that the inaccessible tiles are faded somewhat so that I don&#x27;t inadvertently try to match them.
    • rofko7 hours ago
      Thank you for the feedback! I will triple check the rules
    • thih95 hours ago
      &gt; Tiles are supposed to be free when there is a side free<p>No.<p>According to wikipedia[1]: &quot;A tile is said to be open or exposed if it can be moved either left or right without disturbing other tiles.&quot;. Also look at the photo in the wikipedia article[2]. This implementation looks correct to me.<p>[1]: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Mahjong_solitaire" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Mahjong_solitaire</a><p>[2]: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Mahjong_solitaire#&#x2F;media&#x2F;File:Mahjong_solitaire-02.jpg" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Mahjong_solitaire#&#x2F;media&#x2F;File:...</a>
  • rdescartes5 hours ago
    Should it be named Shanghai solitaire Or Mahjong Solitaire ?
    • gchamonlive5 hours ago
      Maybe Mahjunk, am I right?<p><i>slowly lowers right hand in awkward silence</i>
  • Bender3 hours ago
    I think this is a good example of what CSS can do and probably was not easy to make but I will likely stick with Mahjong that comes with most Linux distributions as they follow rules that people I may end up playing against would know and they have many layouts. I could see this being applied to other things however such as games that require building or repairing something. Or <i>something similar to</i> Minecraft?<p>Impressive work!
    • rafabulsing3 hours ago
      Minecraft in CSS has been done, actually! <a href="https:&#x2F;&#x2F;benjaminaster.com&#x2F;css-minecraft&#x2F;" rel="nofollow">https:&#x2F;&#x2F;benjaminaster.com&#x2F;css-minecraft&#x2F;</a><p>Discussion: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=44100148">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=44100148</a>
      • Bender3 hours ago
        Nice! No idea how I missed that one.
    • koolala3 hours ago
      I wonder if versus Mahjong Solitaire could be like Battle Tetris. I&#x27;ve never heard of people playing it competitively.
  • sanj5 hours ago
    This is lovely! Can I suggest make sure that the board is solveable?
  • akersten6 hours ago
    If I click fast enough on mobile it starts trying to select&#x2F;highlight text, should be able to prevent that with CSS too. I find this is somehow a common issue that separates a lot of PWAs from real apps, the browser text engine is still lurking there in the background trying to recall us all to the glory days of hypermedia
    • koolala3 hours ago
      Mahjong tiles are in Unicode so they could convert that functionality into accessibility information.<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Mahjong_Tiles_(Unicode_block)" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Mahjong_Tiles_(Unicode_block)</a>
  • aranw2 hours ago
    Really enjoyed that although my final two tiles were stacked and couldn&#x27;t finish the game!
    • rofko36 minutes ago
      That&#x27;s unfortunate! I&#x27;ll make sure to patch that case.
  • thenthenthen4 hours ago
    There are some super weird bugs, sometimes only one of the two pieces are removed and sometimes the field goes blank? Also on every move the faves change?! iOS here. And yeah, no majiang, but still super cool! Nostalgic vibes waiting for my fries and playing the Photo Play touch screen gambling machine (after unlocking it by tapping the words photo and play on the logo with two different fingers and entering the code)
  • haunter6 hours ago
    Now make it _real_ mahjong (; <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Mahjong" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Mahjong</a><p>Which makes me wonder which ruleset would be the easiest to implement. Probably MCR or HK, riichi has too many edge cases and sepcial rules and yakus.
    • snvzz6 hours ago
      Riichi is the fun one, where skill weights over luck.
      • haunter6 hours ago
        I also prefer riichi. Furiten is such a game changer, all other rulesets feel a bit less after that
        • whateveracct6 hours ago
          Riichi is a good candidate for a video game due to all the specific rules. It has a lot of room for QoL. I have an app on my phone [1] that has made it fun to play and learn thanks to the guidance it has with the rules<p>[1] <a href="https:&#x2F;&#x2F;kemono.games&#x2F;game&#x2F;Kemono-Mahjong" rel="nofollow">https:&#x2F;&#x2F;kemono.games&#x2F;game&#x2F;Kemono-Mahjong</a> hunky furries aside, it&#x27;s a really good single player Riichi app lol
          • haunter5 hours ago
            &gt;hunky furries<p>Well the other options are the gooner gacha games like Mahjong Soul and Riichi City lol<p>Personally I play on Mahjong Soul because apart from Tenhou that has the most populated PvP with enough players in each rank + it&#x27;s a butter smooth experience with all the small features. And I love the special modes like Battle of Asura
        • koolala3 hours ago
          I&#x27;ve been looking for a free one with really good helper UI to keep track of all the rules.
          • haunter2 hours ago
            Helper UI per se won&#x27;t exist because there are so many little things.<p>If we talk about riichi then the best tutorial is probably in Kemono Mahjong <a href="https:&#x2F;&#x2F;cyberdog.ca&#x2F;kemono-mahjong&#x2F;" rel="nofollow">https:&#x2F;&#x2F;cyberdog.ca&#x2F;kemono-mahjong&#x2F;</a><p>Personally I&#x27;d say Mahjong Soul is the best riichi client out there, that&#x27;s where I play <a href="https:&#x2F;&#x2F;mahjongsoul.yo-star.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;mahjongsoul.yo-star.com&#x2F;</a> Extremely streamlined, good QoL features like tile highlighting (dora too), showing waits and options when you are tenpai, custom lobbies (so you can play with friends), and a pretty robust online ranked system. There is a good tutorial too. The big downside is the gacha system which is purely cosmetic and doesn&#x27;t affect gameplay at all but it can be a turn off for some people.
  • Minor49er5 hours ago
    This is pretty cool. I like the look and the gameplay. Though playing on mobile, some of the roatation gestures caused the page to refesh on me a couple of times since they triggered the browser&#x27;s &quot;drag down to refresh&quot; interaction
  • koolala3 hours ago
    I wish you could rotate all the way. On a phone its also easy to do the refresh gesture.
  • tejonutella2 hours ago
    Looks cool! Wish I knew how to play Mahjong tho
  • DuncanCoffee7 hours ago
    Nice! Wish the supported rotation was bigger, maybe +- 90 instead of only 90 deg?
    • omoikane6 hours ago
      Maybe it was done this way so that they don&#x27;t have to sort the tiles by depth?
      • koolala3 hours ago
        Would it just be the opposite depth of the current sorting once you pass 180 degrees?
  • HardwareLust7 hours ago
    Very nice! Worked great on my shitty old Motorola phone.
  • TazeTSchnitzel4 hours ago
    Is the lack of a perspective projection option deliberate? CSS can do that too.
  • snvzz6 hours ago
    This ain&#x27;t mahjong.<p>Instead, it is some solitaire using mahjong pieces.
    • koolala3 hours ago
      Is mahjong using solitare pieces Rummy?
  • jsmo3 hours ago
    Nice!
  • user39393825 hours ago
    Some people say “mar” jong it’s the weirdest thing.
    • thenthenthen5 hours ago
      Sounds like dongbeinese (or erhua) haha, ‘marjang’
  • apresmoi7 hours ago
    wtf kind of magic is that? I looked at the repo and... you&#x27;ve built a 3d CSS rendering engine to create this?
    • pverheggen7 hours ago
      There&#x27;s some CSS properties specifically for doing 3D, yeah. You use perspective and perspective-origin to create the view frustum, and then CSS transforms to place your elements in 3D space.
  • overflyer4 hours ago
    This has bothing to do with how Mahjong is actually played.
    • koolala3 hours ago
      Isn&#x27;t normal Mahjong 2D? 3D is a different game.
      • pfych29 minutes ago
        This is Mahjong Solitaire - It&#x27;s completely different to actual Mahjong. It&#x27;s a completely different game that uses Mahjong tiles.