Review Request: Fixing positions on the fifteenPuzzle to make it solvable

Aaron Seigo aseigo at kde.org
Tue Aug 3 18:11:58 CEST 2010


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/4867/#review6772
-----------------------------------------------------------



/trunk/KDE/kdeplasma-addons/applets/fifteenPuzzle/src/piece.cpp
<http://reviewboard.kde.org/r/4867/#comment6586>

    would it make more sense to just pass in a larger id number when Pieces are created instead of adding one to the id here? that way the id passed to Piece are the id's they'll actually have. i find such consistency makes code easier to maintain over time. :)



/trunk/KDE/kdeplasma-addons/applets/fifteenPuzzle/src/piece.cpp
<http://reviewboard.kde.org/r/4867/#comment6583>

    here's another m_id == 0 that has been missed.
    
    perhaps instead of comparing against a magic id number, there should be a boolean member in Piece that holds whether or not it is a blank piece and then that can be calculated exactly once in the constructor.


- Aaron


On 2010-08-03 15:34:07, Alex Raymond wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/4867/
> -----------------------------------------------------------
> 
> (Updated 2010-08-03 15:34:07)
> 
> 
> Review request for Plasma and Aaron Seigo.
> 
> 
> Summary
> -------
> 
> Previously, the initial piece arrangement for the fifteenPuzzle was:
> 
> -   1   2   3
> 4   5   6   7
> 8   9  10  11
> 12  13 14  15
> 
> This arrangement makes the puzzle unsolvable. So the correct initial position must be with the empty space on the last tile, instead of the first.
> 
> 
> Diffs
> -----
> 
>   /trunk/KDE/kdeplasma-addons/applets/fifteenPuzzle/src/fifteen.cpp 1158347 
>   /trunk/KDE/kdeplasma-addons/applets/fifteenPuzzle/src/piece.cpp 1158347 
> 
> Diff: http://reviewboard.kde.org/r/4867/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Alex
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/plasma-devel/attachments/20100803/9dc7f202/attachment.htm 


More information about the Plasma-devel mailing list