From kde-games-devel Sat Jan 16 14:51:24 2010 From: Julian Helfferich Date: Sat, 16 Jan 2010 14:51:24 +0000 To: kde-games-devel Subject: Re: [Kde-games-devel] KPat Solver Error Message-Id: <6834b9781001160651q65a8b6a2k9c0d0de35fcce7c9 () mail ! gmail ! com> X-MARC-Message: https://marc.info/?l=kde-games-devel&m=126365352701463 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============0091240892==" --===============0091240892== Content-Type: multipart/alternative; boundary=0016e6d566ad1752a0047d4941c1 --0016e6d566ad1752a0047d4941c1 Content-Type: text/plain; charset=ISO-8859-1 Hello, i think i found a way to recreate this bug: 1. Start Kpat, choose Klondike as the game 2. Change the game type to draw 1 / draw 3 3. Press demo The problem is, that the solver gets no information about the changing of the game type, so it calculates the win moves for draw 1, even if you changed the game to draw 3 (or vice versa). The solution is as easy as adding one line in the gameTypeChanged slot: --- klondike.cpp (revision 1075656) +++ klondike.cpp (working copy) @@ -254,6 +254,7 @@ if ( allowedToStartNewGame() ) { setEasy( options->currentItem() == 0 ); + setSolver( new KlondikeSolver( this, pile->draw() ) ); startNew( gameNumber() ); } else (It doesn't create a memory leak, because setSolver cares about deleting the old solver) I would be glad, if somebody else could recreate the bug by using my short instructions, testing the bugfix and (if it's working) commit it to svn. Julian 2010/1/14 John Schneiderman wrote > On Thursday 14 January 2010 08:43:54 Parker Coates wrote: > > Yes that is the now infamous bug 201073 [1]. If you see this issue > > frequently, it would really help us out if you could create a save > > file of the game just one step before it makes an illegal move and > > attach it to that bug report, we would be most appreciative. If you > > could also confirm whether it happens only when playing draw 1 or draw > > 3, that would be a big help as well. > > Parker, > > I'll certainly do that. > > John S. > > --0016e6d566ad1752a0047d4941c1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello,

i think i found a way to recreate this bug:

1. Start K= pat, choose Klondike as the game
2. Change the game type to draw 1 / dra= w 3
3. Press demo

The problem is, that the solver gets no informa= tion about the changing of the game type, so it calculates the win moves fo= r draw 1, even if you changed the game to draw 3 (or vice versa). The solut= ion is as easy as adding one line in the gameTypeChanged slot:

--- klondike.cpp=A0=A0=A0 (revision 1075656)
+++ klondike.cpp=A0=A0= =A0 (working copy)
@@ -254,6 +254,7 @@
=A0=A0=A0=A0 if ( allowedToSta= rtNewGame() )
=A0=A0=A0=A0 {
=A0=A0=A0=A0=A0=A0=A0=A0 setEasy( option= s->currentItem() =3D=3D 0 );
+=A0=A0=A0 setSolver( new KlondikeSolver= ( this, pile->draw() ) );
=A0=A0=A0=A0=A0=A0=A0=A0 startNew( gameNumber() );
=A0=A0=A0=A0 }
=A0= =A0=A0=A0 else

(It doesn't create a memory leak, because setSolv= er cares about deleting the old solver)

I would be glad, if somebody= else could recreate the bug by using my short instructions, testing the bu= gfix and (if it's working) commit it to svn.

Julian

2010/1/14 John Schneiderman wr= ote
On Thursday 14 January 2010 08:43:54 Parker Coates wrote:=
> Yes that is the now infamous bug 201073 [1]. If you see this issue
> frequently, it would really help us out if you could create a save
> file of the game just one step before it makes an illegal move and
> attach it to that bug report, we would be most appreciative. If you > could also confirm whether it happens only when playing draw 1 or draw=
> 3, that would be a big help as well.

Parker,

I'll certainly do that.

John S.

--0016e6d566ad1752a0047d4941c1-- --===============0091240892== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kde-games-devel mailing list kde-games-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-games-devel --===============0091240892==--