MahJong tile placement algorithm

Posted By: DavidLancaster

MahJong tile placement algorithm - 06/11/08 01:32

Would anyone know of a website or something that has information about how to write a successful MahJong tile placement algoritm? ie tell a computer how to place tiles on a board so that there is always at least 1 possible solution. I'm stumped how to do it, I keep running into small niches in my head.

Thank you!

David
Posted By: TigerTao

Re: MahJong tile placement algorithm - 06/22/08 23:05

I think this problem is a huge can of worms smile

I found this site

http://home.halden.net/vkp/vkp/layouts.html

It seems you can either go the random route(often unwinnable)or set up many predefined patterns with no algorithm(always winnable).

This though may help

http://www.formauri.es/personal/pgimeno/mj/mjsol.html

Hope this clears up the nature of your problem.
Posted By: DavidLancaster

Re: MahJong tile placement algorithm - 06/24/08 02:26

Thanks Tiger.

I managed to get an algoritm working with tiles that were only on either even or odd rows on a layer. ie if the bottom of a tile met the halfway point of another it introduces another complication. As when I place the tiles I need to make sure that I'm doing two things:

-place the tile in a location that is available
-place the tile in a location that doesn't block it's pair tile

I managed to get solutions working for certain layouts but it's really difficult to come up with an algorithm that works for all layouts.

Kyodai Mahjong somehow does it brilliantly. I think smile
© 2024 lite-C Forums