Bug 329052 - Select a tile, then do a Shuffle; afterwards the selection, hints, etc... maybe wrong.
Summary: Select a tile, then do a Shuffle; afterwards the selection, hints, etc... may...
Status: RESOLVED FIXED
Alias: None
Product: kmahjongg
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Debian stable Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-20 21:55 UTC by BryanFRitt
Modified: 2016-01-04 00:55 UTC (History)
3 users (show)

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


Attachments
A KMahjongg file that can be played with. (12.93 KB, application/octet-stream)
2013-12-20 22:21 UTC, BryanFRitt
Details
A picture showing what can happen after a select shuffle select undo (63.96 KB, image/png)
2013-12-20 22:31 UTC, BryanFRitt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description BryanFRitt 2013-12-20 21:55:15 UTC
Select a tile, then do a 'Shuffle', click on a tile that would have been a match with the originally selected tile, now it plus the tile now in what was the selected position, will be taken away, even if they don't match. Undo will put back both tiles as the tile that was originally selected, or the last one clicked on. (as the last one clicked on and the original one clicked on are the same). KMahjongg will mess up the same way even if 'Shuffle' is pressed more than once.

Reproducible: Sometimes

Steps to Reproduce:
1. Select a tile
2. Do a Shuffle
3. Until neither the original tile selected nor it's identical tiles are not at the original selected spot, Shuffle, (this small chance makes reproducibility a not always?)
4. Click on a tile that matches the original tile clicked on
Actual Results:  
The last tile clicked on plus the tile at the location that the original tile was clicked on will disapear, and undo will bring back both as the original clicked tile.

Expected Results:  
If a tile was selected followed by a shuffle then:
(A.)  Select the new tile at the selected position (and show it's hints/matching tiles, if the hint/matching tiles option is on)
(B.)  Unselect tile, and remove hints.
(C.)  If possible, the new location of the selected tile gets selected (and show it's hints/matching tiles, if the hint/matching tiles option is on)
      If it's not possible to select the new position (like the new location is under a tile or has a tile to the left and right)
        (a.) Do option (A.) or 
        (b.) Do option (B.) or
        (c.) If there's any of it's matching tiles that hasn't been tried yet try B. again but with it's matching tile.
I'd pick (C.)(c.) or (A.) or (B), because (C.)(a.) or (C.)(b.) would make the game less consistent.

Undo could bring back the tiles that where taken away, even they where incorrectly taken away, instead of just assuming they are the same. (This probably just adds inefficiency though)


[analogy]
This bug is like using the Dvorák keyboard, with some games that assume keyboards are QWERTY, and then go by the letter the key represents rather of the physical key position. Using the 'W'  'A'  'S'  'D' keys instead of letters to represent directions makes a big difference in playability. (If you're used to QWERTY, imagine playing a game with ','  'a'  ';'  'h' for up left down right, respectively). 
Try making a shortcut key with xbindkeys-config, it's interface shows how shortcuts can be done both ways at the same time.
Comment 1 BryanFRitt 2013-12-20 22:21:43 UTC
Created attachment 84204 [details]
A KMahjongg file that can be played with.

A KMahjongg file that can be played with to more easily see what's happening.
(left off where it's only one level, and max two wide)
Comment 2 BryanFRitt 2013-12-20 22:31:04 UTC
Created attachment 84205 [details]
A picture showing what can happen after a select shuffle select undo

Notice there's an odd number of Vs and Rs (3X each) which makes this game unwinnable without getting this bug again.
Comment 3 BryanFRitt 2013-12-20 22:49:11 UTC
> 3. Until neither the original tile selected nor it's identical tiles are not
> at the original selected spot, Shuffle

Way too many negatives, etc... should have read something like...
3. While the original tile, or one of the tile(s) it matches with is at the original selected spot, Shuffle.
Comment 4 Jan-Peter Nilsson 2014-12-22 21:52:47 UTC
This sounds like a duplicate of Bug 305036.
Comment 5 Frederik Schwarzer 2016-01-04 00:55:38 UTC
I cannot reproduce this in current master. So it might have been a duplicate.

However, it seems cleaner to unmark the tile on shuffle action. So that's what I did additionally.

Please test the master branch and reopen this report if you thing the issue is not dealt with properly.