Question: THIS IS ALL IN C++ THIS IS THE STARTER CODE AND THE .TXT FILE Please make sure the code runs because sometimes the expected output
THIS IS ALL IN C++






THIS IS THE STARTER CODE AND THE .TXT FILE

Please make sure the code runs because sometimes the expected output doesnt match with the one you provide, thanks.
Lab 1:Micro Sudoku For this lab, you will implement a simple number game. The goal of the game is to fill in a 3x3 board with the numbers 1 - 4 (inclusive), but a number cannot appear next to itself in a row or column. The numbers are read from a file and presented to the user two at a time The user can choose one of the numbers or pass the user loses filled with numbers There are three passes allowed in the game; The game is won if the board is successfully the game on the fourth pass. rogram Specifications Your program should . Show the user the board before each turn and when the game is over . On each turn, display the two numbers the user can choose from. Let the user pick one of the numbers to place or pass . If the user chooses a number, ask where the user wants to put it. Use 0-based indexing o If the user passes, and that is the fourth time the user passes, the game should imme- diately end. The user loses the game . The game should end, and the player wins, if the entire board is filled with numbers Each time the user places a number, you should validate the user's input. Do not allow the user to pick an invalid location (row/column out of range), pick a place that already has a number, or put a number next to itself. For example, if the first row is 1,, 3], a valid move would be to put a 2 in the second spot. An invalid move would be to try to put a 1 or a 3 in the second spot, since the same number cannot appear next to itself You should also validate any menu choices the user gives. For instance, do not allow the user to choose a number to place that isn't one of the available options . You never have to validate that the user has given you the proper datatype, though you can easily by using something like if (cin >> num). If the input cannot be stored in num, this statement is false A262: Lab 1 Check list Each of these items is worth 0.5 points of your grade Your name (and your partner's name, if you have one) must be in a comment at the top of your source file(s) . Your code is generally well formatted, meaning your code is indented properly and each line of code gets its own line All output is grammatically correct with respect to capitalization and sentence struc- ture. Two exceptions that will be allowed to break standard grammar rules are sentence fragments and punctuation at the end of a sentence All output is free of typos, including spelling everything correctly. Beware of typos such as "teh" or "DOuble CAptials" Example Output Here is an example of what your program's output should look like. It is vitally important that your program takes input in the same order as shown here. User input is in lle The goal of this game is to arrange numbers in the 3x3 grid so that the same number does not appear next to itself in either a row or a column. Each round, you will choose between two provided numbers, or you can pass. You can pass three times. The fourth time, you lose! Round G You got numbers 3,3 Choose number (-1 to pass) 3 Enter row and column numbers 0 0 A262: Lab 1 Round 1 31I You got numbers 4, 2 Choose number (-1 to pass) 4 Enter row and column numbers 1 0 Round 2 13 1 4 I I You got numbers 4, 3 Choose number (-1 to pass) 4 Enter row and column numbers 2 0 Value cannot be next to same value Enter row and column numbers 1 1 Value cannot be next to same value Enter row and column numbers 4 5 Invalid row or column Enter row and column numbers 0-4 Invalid row or column Enter row and column numbers 0 1 Round 3 31 41 I4 You got numbers 2, 4 Choose number (-1 to pass) 2 Enter row and column numbers 1 1 A262: Lab 1 Round 4 31 41 4 2 You got numbers 1,1 Choose number (-1 to pass): 1 Enter row and column numbers 0 2 Round 5 1 31 411l 4 2 You got numbers 3, 1 Choose number (-1 to pass) 3 Enter row and column numbers 1 2 Round 6 1 31 411l 4 2 3 You got numbers 1,3 Choose number (-1 to pass) 3 Enter row and column numbers 2 0 Round 7 31 41 1 4 2 3 13 You got numbers 2, 4 A262: Lab 1 Choose number (-1 to pass) 4 Enter row and column numbers 2 1 Round 8 31 41 11 4 2 3 31 41 You got numbers 2,2 Choose number (-1 to pass) 2 Enter row and column numbers 2 2 You win!! 31 41 11 1 4l 21 3 31 41 2 Example of a Loss The goal of this game is to arrange numbers in the 3x3 grid so that the same number does not appear next to itself in either a row or a column Each round, you will choose between two provided numbers, or you can pass. You can pass three times. The fourth time, you lose! Round 0 You got numbers 3, 3 Choose number (-1 to pass): 3 Enter row and column numbers: 00 A262: Lab 1 Round 1 13 You got numbers 4, 2 Choose number (-1 to pass): -1 Round 2 13 You got numbers 4, 3 Choose number (-1 to pass): -1 Round 3 13 You got numbers 2, 4 Choose number (-1 to pass): -1 Round 4 13 A262: Lab1 You got numbers 1, 1 Choose number (-1 to pass): -1 You lose!! 13 I CS262/ main.cpp gameBoard.txt x 49 50 51 #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
