Skip to content

Commit

Permalink
Cleanup of Mahjongg. Fixed the old layout import scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
joeraz committed Mar 17, 2024
1 parent 713f498 commit 96700c5
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 31 deletions.
8 changes: 4 additions & 4 deletions pysollib/gamedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,10 +598,10 @@ def _callback(gi, gt=game_type):
('fc-2.20', tuple(range(855, 897))),
('fc-2.21', tuple(range(897, 900)) + tuple(range(11014, 11017)) +
tuple(range(13160, 13163)) + (16682,)),
('dev', tuple(range(906, 959)) + tuple(range(11017, 11020)) +
tuple(range(5600, 5624)) + tuple(range(18000, 18005)) +
tuple(range(19000, 19012)) + tuple(range(22303, 22311)) +
tuple(range(22353, 22361))),
('dev', tuple(range(906, 959)) + tuple(range(5415, 5419)) +
tuple(range(5600, 5624)) + tuple(range(11017, 11020)) +
tuple(range(18000, 18005)) + tuple(range(19000, 19012)) +
tuple(range(22303, 22311)) + tuple(range(22353, 22361))),
)

# deprecated - the correct way is to or a GI.GT_XXX flag
Expand Down
6 changes: 3 additions & 3 deletions pysollib/games/mahjongg/mahjongg1.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
"hobhodhofhaghCgh" +
"aihCi")
#
r(5008, "Beatle", layout="0aeaagaauaawaaic" +
r(5008, "Beetle", layout="0aeaagaauaawaaic" +
"akcamcaocaqcasca" +
"eeageaieakeameao" +
"eaqeaseaueadgafg" +
Expand Down Expand Up @@ -1027,7 +1027,7 @@
"comcqmcsmcum")

#
r(5063, "New Layout 1", layout="0aeaagaaiaakabpa" +
r(5063, "Temple 1", layout="0aeaagaaiaakabpa" +
"auaawaayaaAaacca" +
"Ccahdajdavdaxdaa" +
"eacealeateaCeaEe" +
Expand Down Expand Up @@ -1406,7 +1406,7 @@
"enbBndgociobkoam" +
"obuovaevagvaivak" +
"Ckh")
r(5084, "Temple 1", layout="0baaacaaeaalaana" +
r(5084, "Temple 2", layout="0baaacaaeaalaana" +
"apaaraataaAaaCab" +
"Eaaacaccalcbncbp" +
"cbrcatcaCcaEcajd" +
Expand Down
4 changes: 2 additions & 2 deletions pysollib/games/mahjongg/mahjongg2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@
"GgaGiaGkaGmaGoaG" +
"q")
#
r(5268, "Temple 2", layout="0aaaaaeaaiabchbd" +
r(5268, "Temple 3", layout="0aaaaaeaaiabchbd" +
"abghbhacahcbocca" +
"cehcfocgaciadchd" +
"dodeadghdhaeaheb" +
Expand Down Expand Up @@ -1273,7 +1273,7 @@
"ougauiavchvdavgh" +
"vhawaaweawi")
#
r(5269, "Temple 3", layout="0aacaagaakabahbb" +
r(5269, "Temple 4", layout="0aacaagaakabahbb" +
"abehbfabihbjacco" +
"cchcdacgocghchac" +
"kadahdbadeodehdf" +
Expand Down
73 changes: 73 additions & 0 deletions pysollib/games/mahjongg/mahjongg3.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,80 @@
"cyicykcymdAadAcd" +
"AedAgdAidAkdAmdA" +
"o")
r(5415, "Spider", layout="0aaebcfaclacqbea" +
"begbelbeqbgabghb" +
"glbgqbibbidbihbi" +
"lbipbkdbkhbklbko" +
"alfaljhmgamhhmih" +
"mkamlbmnampbnban" +
"fanjonjonlaodhog" +
"aohoohhoihokaolh" +
"omaonoonhooaopao" +
"rhpeapfapjopjvpk" +
"oplhpqaptaqdhqga" +
"qhoqhhqihqkaqlhq" +
"maqnoqnhqoaqpaqr" +
"brbarfarjorjorlh" +
"sgashhsihskaslbs" +
"naspatfatjbudbuh" +
"bulbuobwbbwdbwhb" +
"wlbwpbyabyhbylby" +
"qbAabAgbAlbAqbCf" +
"aClaCqaEe")
r(5416, "Waves", layout="0eafeahabmacadcf" +
"dchadmaeacefcehh" +
"emhfaafmagacgfcg" +
"higmihaahmaiabif" +
"bihiimijaajmakab" +
"kfbkhikmilaalmam" +
"aamfamhhmmhnaanm" +
"aoaaofaohapmaqab" +
"qfbqharmasabsfbs" +
"hatmauacufcuhhum" +
"hvaavmawacwfcwhi" +
"wmixaaxmayadyfdy" +
"hiymizaazmaAaeAf" +
"eAhiAmiBaaBmaCah" +
"CmhDaaDmaEaaFmaG" +
"a")
r(5417, "Hot Coffee", layout="0aarbcradfadhadj" +
"adlaeaaencerbffb" +
"fhbfjbflafpagbbg" +
"ndgrchfchhchjchl" +
"bhpcindircjfcjhc" +
"jjcjlcjpCjrckndk" +
"ralaclfclhcljcll" +
"clpClrcmndmranbc" +
"nfcnhcnjcnlbnpbo" +
"ndorbpfbphbpjbpl" +
"appaqncqrarfarha" +
"rjarlbsratgatlau" +
"ravgavlaxhaxjaxl")
r(5418, "Zigzag", layout="0aabaajaaracahcb" +
"accacihcjackacqh" +
"cracsaebiecaedae" +
"hieiaejvejiekael" +
"aepieqaeragcigda" +
"gehgfaggighagihg" +
"jagkiglagmhgnago" +
"igpagqaidiieaifv" +
"ifiigaihailiimai" +
"nviniioaipakehkf" +
"akgakmhknakoamfa" +
"mnaqbaqjaqrasahs" +
"bascasihsjaskasq" +
"hsrassaubiucauda" +
"uhiuiaujvujiukau" +
"laupiuqaurawciwd" +
"awehwfawgiwhawih" +
"wjawkiwlawmhwnaw" +
"oiwpawqaydiyeayf" +
"vyfiygayhayliyma" +
"ynvyniyoaypaAehA" +
"faAgaAmhAnaAoaCa" +
"aCfaCnaCs")

# ----------------------------------------------------------------------

r(5801, "Faro", name="Double Mahjongg Faro", ncards=288, layout="0aaaha" +
"baachadaae" +
Expand Down
44 changes: 23 additions & 21 deletions pysollib/games/mahjongg/mahjonggL.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,27 +325,29 @@
"hDeaDgaDohEgaEia" +
"EmhEohFiaFkhFmhG" +
"k")
r(5614, "New Layout 2", layout="0CabCadCafacapca" +
"hccvccacepcehcgv" +
"cgheaveaaecpeche" +
"eveeaegpegCfaCfc" +
"CfeCfgagapgahgcv" +
"gcagepgehggvggCh" +
"aChcCheChghiavia" +
"aicpichievieaigp" +
"igakaqkahkcwkcak" +
"eqkehkgwkghmawma" +
"amcqmchmewmeamgq" +
"mgaoaqoahocwocao" +
"eqoehogwoghqavqa" +
"aqcpqchqevqeaqgp" +
"qgCraCrcCreCrgas" +
"apsahscvscasepse" +
"hsgvsgCtaCtcCteC" +
"tghuavuaaucpuchu" +
"evueaugpugawapwa" +
"hwcvwcawepwehwgv" +
"wgCybCydCyf")
# Contains floating tiles, so a usable tile may not be visible.
# Unplayable without serious work.
# r(5614, "New Layout 2", layout="0CabCadCafacapca" +
# "hccvccacepcehcgv" +
# "cgheaveaaecpeche" +
# "eveeaegpegCfaCfc" +
# "CfeCfgagapgahgcv" +
# "gcagepgehggvggCh" +
# "aChcCheChghiavia" +
# "aicpichievieaigp" +
# "igakaqkahkcwkcak" +
# "eqkehkgwkghmawma" +
# "amcqmchmewmeamgq" +
# "mgaoaqoahocwocao" +
# "eqoehogwoghqavqa" +
# "aqcpqchqevqeaqgp" +
# "qgCraCrcCreCrgas" +
# "apsahscvscasepse" +
# "hsgvsgCtaCtcCteC" +
# "tghuavuaaucpuchu" +
# "evueaugpugawapwa" +
# "hwcvwcawepwehwgv" +
# "wgCybCydCyf")
r(5615, "Big X", layout="0aacaamhbchbmacb" +
"occacdaclocmacnh" +
"dbhddhdlhdnaeaae" +
Expand Down
2 changes: 1 addition & 1 deletion scripts/mahjongg_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def decode_layout(layout):
tx = alpha.find(layout[i+1])
ty = alpha.find(layout[i+2])
assert n >= 0 and tx >= 0 and ty >= 0
for tl in range(level, level + height):
for tl in range(int(level), int(level) + int(height)):
tiles.append((tl, tx, ty))
tiles.sort()
return tiles
Expand Down

0 comments on commit 96700c5

Please sign in to comment.