Help on Xcode, please. SUDOKU game. Find an online game book and code up 40 poss
ID: 3572516 • Letter: H
Question
Help on Xcode, please. SUDOKU game. Find an online game book and code up 40 possible Sudoku games. ( use a file to store the 40 possible games) 10 very easy 10 easy 10 medium 10 hard Have the user pick the level (very easy, easy, medium, hard) and then have the computer randomly pick one(1) of the ten(10) games for that level. Print out the game board ( 9 by 9 ), and load it with the initial values for the game, in other words pre-populate the game board with those initial values and make them a certain color like BLUE. The cells where the user is to input values will be blank. Next, have an easy to use method where a user can select an EMPTY cell and enter a number (Color Green), between 1 and 9. Be sure to validate that the user is only entering values into an EMPTY cell.. Have the computer check if the user input is a valid value… Inform the user if the number entered by them is not the correct number for the cell.. by placing the incorrect number in the chosen cell for 5 seconds FLASHING, then erase/blank the cell… Keep track of the number of errors the user makes. Possible scoring… 100 points if game complete successfully with no errors… subtract 5 points per error. Show current score on screen. Code for the following winning conditions with these messages. At end of game if score == 100 then ‘Excellent Player, should try next level’ If score > = 80 and < 100 then ‘ Good player, keep practicing on this level’ If score >= 60 and < 80 then ‘OK player… keep practicing on this level if you dare’ If score >= 40 and < 60 ‘Well.. suggest trying a easier level’ If score < 40 then ‘Watch this video on how to play’…. Have a quit game option available while playing Have a new game option while playing Keep track of the number of games played at each level and average of score at that level. (hint files) Have option to allow user see average for all levels. THIS GAME IS to be written using C++ Classes… The main function must look like this: Int main() { SUDOKU S1; // instantiate game. S1.startGame(); // start game.. } All classes are to be written using separate .h interface file and the .cpp implementation file. There will be NO global variables. This is a character based application, not a GUI.
Explanation / Answer
This is a basic sudoku code program validations may be applied with some modification I guess this may help you out /* * C++ Program to Solve Sudoku Problem using BackTracking */ #include #include #include #include using namespace std; #define UNASSIGNED 0 #define N 9 bool FindUnassignedLocation(int grid[N][N], int &row, int &col); bool isSafe(int grid[N][N], int row, int col, int num); /* assign values to all unassigned locations for Sudoku solution */ bool SolveSudoku(int grid[N][N]) { int row, col; if (!FindUnassignedLocation(grid, row, col)) return true; for (int num = 1; numRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.