Bug 273971 - Doesn't recognize some open tiles.
Summary: Doesn't recognize some open tiles.
Status: RESOLVED FIXED
Alias: None
Product: kmahjongg
Classification: Applications
Component: general (show other bugs)
Version: 0.8
Platform: Mandriva RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Mauricio Piacentini
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-23 17:30 UTC by Tom Crone
Modified: 2023-01-22 14:09 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
saved game described above. (12.89 KB, application/octet-stream)
2011-05-23 17:30 UTC, Tom Crone
Details
saved game (12.94 KB, application/octet-stream)
2011-06-24 11:42 UTC, Christian Boltz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Crone 2011-05-23 17:30:29 UTC
Created attachment 60245 [details]
saved game described above.

Version:           0.8 (using KDE 4.4.5) 
OS:                Linux

In board layout Cross, program is not recognizing some open tiles.

In layout:                        __
                |              __|  |__
                |           __|  |__|T1|
                |        __|  |__|  |__|
                |  All  |  |__|  |__|
                |  one  |__|  |__|
          board |  hi   |  |__|
         center |       |__|
          line->|
                |               __
                |       both   |  |__
                |      stacks  |__|  |
                |     three hi    |__|

only tile T1 is considered open.

Reproducible: Sometimes

Steps to Reproduce:
I have had problems several times with this layout.


Expected Results:  
Should have recognized 4 other open tiles.
Comment 1 Christian Boltz 2011-06-24 11:42:36 UTC
Created attachment 61295 [details]
saved game

This bug still exists in KDE 4.6.0 on openSUSE 11.4.

There's an interesting detail: In the status bar, I see
    Entfernt: -24080 / 144 Restliche Paare: 0
    translated:  Removed: -24080 / 144 Remaining pairs: 0

Needless to say that the negative number of removed bricks is, well, strange...

The status bar also says:
    Spielnummer 179639634   (translated: game number)
    Fehler beim Erstellen des Spiels  (translated: error when creating the game)
Comment 2 Christian Krippendorf 2011-11-24 10:27:02 UTC
Hey,

this problem exist cause the game creation itself was failed and there are only 64 tries to generate a solveable game. If it fails, ... all will fail.

I think there should be an algo which creates a solveable game every time. Maybe by build a game as placing tiles on valid positions on the board. I already build such an algo in JMahjongg on github.

If i got time for, i will try to search and solve this bug.

<code>
// Now try to position tiles on the board, 64 tries max.
for( short nr=0; nr<64; nr++ )
{
    if( Game->generateStartPosition2() )
    {
        drawBoard(true);
        setStatusText( i18n("Ready. Now it is your turn.") );
        cheatsUsed=0;
        emit gameCalculated();
        return;
    }
}

drawBoard(false);
setStatusText( i18n("Error generating new game!") );
</code>

Best Regards
Comment 3 Brice Hunt 2013-06-04 20:35:40 UTC
Am having this problem with the "Garden" layout in KMahjongg 0.8 on KDE 4.8.4 in Debian Jessie. Didn't notice it until today, despite having played this layout multiple times before.
Comment 4 Andrew Crouthamel 2018-11-10 03:24:58 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 5 Andrew Crouthamel 2018-11-21 04:40:47 UTC
Dear Bug Submitter,

This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? This bug will be moved back to REPORTED Status for manual review later, which may take a while. If you are able to, please lend us a hand.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Christian Boltz 2018-12-07 22:28:57 UTC
Tested in KMahjongg 0.9 on KDE Frameworks 5.52.0 on latest openSUSE Tumbleweed:

If I load the saved game from comment #1, the status bar still shows the funny text. (I have no idea about the file format for saved games, maybe these numbers are stored in and read from the file?)

On the positive side, I _can_ now remove tiles (the "plant" in the top-left stack + its counterpart below), and after doing that, the "remaining pairs" in the status bar shows the correct value. I was able to continue the game until there were really no pairs left.
Comment 7 Justin Zobel 2023-01-19 00:18:48 UTC
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 8 Christian Krippendorf 2023-01-22 14:09:14 UTC
Hello,

I tested both save game that has been posted. The right tiles that are open can be selected and the game can be finished. I would suggest to mark this bug as resolved. The problem with the wrong number might be due to old binary save game file loading into current version with a failed game creation.

Thanks to every who has contributed here.
Greetings Christian