Bug 435211 - Picmi wrongly calls a single black cell correct when there should be two
Summary: Picmi wrongly calls a single black cell correct when there should be two
Status: RESOLVED FIXED
Alias: None
Product: picmi
Classification: Applications
Component: general (show other bugs)
Version: 2.0.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Jakob Gruber
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-01 09:11 UTC by phma
Modified: 2022-02-09 21:38 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description phma 2021-04-01 09:11:11 UTC
SUMMARY
There's a column with the numbers "1 1".
xx*x_xxxxx correctly displays one 1 in blue and the other in black.
xx*x*xxxxx correctly displays both 1s in blue.
xx*xxxxxxx wrongly displays both 1s in blue.

STEPS TO REPRODUCE
1. Play a game which has "1 1" in a row or column.
2. Mark all of them with an X except one, which mark with black.

OBSERVED RESULT
Both 1s turn blue.

EXPECTED RESULT
Either only one 1 should turn blue, or neither should.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Ubuntu Focal
(available in About System)
KDE Plasma Version: 4.5.18
KDE Frameworks Version: not sure what package that is
Qt Version: 5.12.8

ADDITIONAL INFORMATION
Comment 1 Jakob Gruber 2021-04-01 13:01:21 UTC
I can repro, this is a bug. (Not sure when I'll get around to fixing it, patches welcome.)
Comment 2 Martin Walch 2022-01-23 20:59:08 UTC
This happens when two conditions are met:

1. all fields of a line or row are filled with either boxes or crosses, i.e. there is no hole left
2. the pattern is a concatenation of two identical sub-patterns

For example
☒☒☒☒☒☒☒▣☒▣▣☒▣
would satisfy
1 2 1 1 2 1

What is the desired behavior in that case?
Comment 3 Jakob Gruber 2022-02-04 16:42:32 UTC
(In reply to Martin Walch from comment #2)
> This happens when two conditions are met:
> 
> 1. all fields of a line or row are filled with either boxes or crosses, i.e.
> there is no hole left
> 2. the pattern is a concatenation of two identical sub-patterns
> 
> For example
> ☒☒☒☒☒☒☒▣☒▣▣☒▣
> would satisfy
> 1 2 1 1 2 1
> 
> What is the desired behavior in that case?

Hi Martin, thanks for your recent work on Picmi. Since the pattern is obviously not satisfied, the desired behavior is for the numbers to show 'all black'. When a cross is again removed, leaving an empty box, e.g.:

☒☐☒☒☒☒☒▣☒▣▣☒▣

The right side of `1 2 1 1 2 1` would again be satisfied.
Comment 4 Bug Janitor Service 2022-02-07 22:11:33 UTC
A possibly relevant merge request was started @ https://invent.kde.org/games/picmi/-/merge_requests/4
Comment 5 Martin Walch 2022-02-07 22:17:51 UTC
(In reply to Jakob Gruber from comment #3)
> Hi Martin, thanks for your recent work on Picmi. Since the pattern is
> obviously not satisfied, the desired behavior is for the numbers to show
> 'all black'. When a cross is again removed, leaving an empty box, e.g.:
> 
> ☒☐☒☒☒☒☒▣☒▣▣☒▣
> 
> The right side of `1 2 1 1 2 1` would again be satisfied.

Hi Jakob,

this looks like an easy solution (https://invent.kde.org/games/picmi/-/merge_requests/4). Maybe you can take a look if it is adequate and fits with the game.
Comment 6 Albert Astals Cid 2022-02-09 21:38:14 UTC
Git commit f8a03f1f98f9288e6d6b6cd705a3f430511550cf by Albert Astals Cid, on behalf of Martin Walch.
Committed on 09/02/2022 at 21:38.
Pushed by aacid into branch 'master'.

Always mark full lines with wrong streak sizes as completely unsatisfied

Streak checks happen in normal and in reverse order. On full lines this
means that all streaks are matched twice against the solution, yielding
markers that may feel counter-intuitive.

In particular, a solution that consists of two identical sub-patterns is
marked as completely satisfied on a full line that contains the sub-pattern
only once. A board may even seem completely solved, while it is not.

To prevent this, extend the preliminary checks to completely reject full
lines with the wrong number of streaks.

M  +8    -2    src/logic/streaks.cpp

https://invent.kde.org/games/picmi/commit/f8a03f1f98f9288e6d6b6cd705a3f430511550cf