File indexing completed on 2024-10-13 03:45:46

0001 /****************************************************************************
0002  *    Copyright 2011  Ian Wadham <iandw.au@gmail.com>                       *
0003  *    Copyright 2015  Ian Wadham <iandw.au@gmail.com>                       *
0004  *                                                                          *
0005  *    This program is free software; you can redistribute it and/or         *
0006  *    modify it under the terms of the GNU General Public License as        *
0007  *    published by the Free Software Foundation; either version 2 of        *
0008  *    the License, or (at your option) any later version.                   *
0009  *                                                                          *
0010  *    This program is distributed in the hope that it will be useful,       *
0011  *    but WITHOUT ANY WARRANTY; without even the implied warranty of        *
0012  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
0013  *    GNU General Public License for more details.                          *
0014  *                                                                          *
0015  *    You should have received a copy of the GNU General Public License     *
0016  *    along with this program.  If not, see <http://www.gnu.org/licenses/>. *
0017  ****************************************************************************/
0018 
0019 #ifndef GLOBALS_H
0020 #define GLOBALS_H
0021 
0022 #include <QList>
0023 
0024 // Values used in vacant and unusable cells (e.g. for Samurai puzzles).
0025 #define VACANT 0
0026 #define UNUSABLE -1
0027 
0028 enum SudokuType {Plain, XSudoku, Jigsaw, Samurai, TinySamurai, Roxdoku, Aztec,
0029                  Mathdoku, KillerSudoku, EndSudokuTypes};
0030 
0031 enum Difficulty {VeryEasy  = 0, Easy = 1, Medium = 2, Hard = 3, Diabolical = 4,
0032                  Unlimited = 5};
0033 
0034 enum Symmetry   {DIAGONAL_1, CENTRAL, LEFT_RIGHT, SPIRAL, FOURWAY,
0035                  RANDOM_SYM, LAST_CHOICE = RANDOM_SYM, NONE, DIAGONAL_2};
0036 
0037 enum CageOperator {NoOperator, Divide, Subtract, Multiply, Add};
0038 
0039 using BoardContents = QList<int>;
0040 
0041 // The maximum digit that can be used in a Mathdoku or Killer Sudoku puzzle.
0042 const int MaxMathOrder = 9;
0043 
0044 struct Statistics {
0045     char *     typeName;
0046     SudokuType type;
0047     int        blockSize;
0048     int        order;
0049     bool       generated;
0050     qint32     seed;
0051     int        nClues;
0052     int        nCells;
0053     int        nSingles;
0054     int        nSpots;
0055     int        nDeduces;
0056     int        nGuesses;
0057     int        firstGuessAt;
0058     float      rating;
0059     Difficulty difficulty;
0060 };
0061 
0062 #endif // GLOBALS_H