Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Related: I wrote a mahjong game many years back (the tile matching version; not real mahjong).

It turns out you can have unwinnable boards if you build them purely randomly.

So I ended up having the app play the board in reverse to make sure it was winnable!

It still managed to hit stalemates, while playing backwards, but they were very rare. I just restarted instead of trying to avoid that situation algorithmicly.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: