X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0c65afdb458fcb63936fd3db8a2b83ea89a9ef10..7eae80a04b477d1200af666397cd387cf143ac0b:/demos/bombs/game.cpp diff --git a/demos/bombs/game.cpp b/demos/bombs/game.cpp index 3778780869..ae07b7dac0 100644 --- a/demos/bombs/game.cpp +++ b/demos/bombs/game.cpp @@ -2,17 +2,13 @@ // Name: bombs1.cpp // Purpose: Implementation of the class BombsGame // Author: P. Foggia 1996 -// Modified by: Wlodzimierz Skiba (ABX) 2003 +// Modified by: Wlodzimierz Skiba (ABX) since 2003 // Created: 1996 // RCS-ID: $Id$ // Copyright: (c) 1996 P. Foggia // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -# pragma implementation -#endif - #include "wx/wxprec.h" #ifdef __BORLANDC__ @@ -43,7 +39,7 @@ BombsGame::~BombsGame() } // Initialize the play field. Returns false on failure -bool BombsGame::Init(int aWidth, int aHeight) +bool BombsGame::Init(int aWidth, int aHeight, bool easyCorner) { m_gridFocusX = m_gridFocusY = -1; @@ -75,6 +71,15 @@ bool BombsGame::Init(int aWidth, int aHeight) } } + /* Force (0,0) not to have a bomb for those that don't want to have + to guess on the first move. Better would be to for the MS rule that + whatever is picked first isn't a bomb. + */ + if(easyCorner) + { + m_field[0] = BG_HIDDEN; + } + m_numBombCells = 0; for(x=0; x