]> git.saurik.com Git - wxWidgets.git/blobdiff - demos/bombs/game.cpp
Easy corner for new wxBombers (as requested in patch #1178276).
[wxWidgets.git] / demos / bombs / game.cpp
index 3778780869ebafe2d9fca0168d9cb25ac5e8e5d1..eed0dc622ccf99558ae95b75b0649f1f7f5c339d 100644 (file)
@@ -43,7 +43,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 +75,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<m_width; x++)
         for(y=0; y<m_height; y++)