Home / Expert Answers / Computer Science / advanced-level-school-python-programming-need-helps-4-a-computer-program-can-generat-pa428

(Solved): Advanced level school Python programming. need helps. 4 A computer program can generat ...



student submitted image, transcription available below

student submitted image, transcription available below

student submitted image, transcription available below

Advanced level school Python programming. need helps.

4 A computer program can generate a simple Sudoku puzzle using a two-dimensional array. An example of this puzzle is: The first step to creating this puzzle is to develop a program to display the two-dimensional array as a grid. This program will display the grid as: \begin{tabular}{llll} 4 & 3 & 2 & 1 \\ 1 & 2 & 4 & 3 \\ 3 & 4 & 1 & 2 \\ 2 & 1 & 3 & 4 \end{tabular} Task 4.1 Create a program design that will declare, initialise and display the example puzzle shown. This design will: - make use of top-down design - include the data structure to represent the puzzle as a grid - initialise the grid using the values shown - make use of appropriate procedures and/or functions. Task 4.2 Write program code to display the puzzle designed in Task 4.1. The puzzle is said to be valid if it follows these rules: - It consists of four quadrants. - The numbers in each quadrant must add up to ten. - Each horizontal and vertical row of the puzzle must also add up to ten. - No number can be repeated in the same row, same column or same quadrant of the puzzle. A good strategy for creating puzzles is to start with a valid 'base' puzzle and perform transformations on it to create new puzzles. You will write proaram code to create new valid buzzles. Task 4.3 Nrite additional program code, with brief internal commentary to identify each transformation. The program code will: create a method of selecting, at random, two of the four possible transformations to be applied to the puzzle call a sub-program for each of the required transformations randomly select which rows will be transformed for transformations 1 and 2, for example, either the top or bottom two rows (for transformation 1) OR either the left-most or right-most two columns (for transformation 2 ) respectively display the puzzle before each transformation is applied and after the final transformation. Before each transformation, it will also display the name of the transformation being carried out. For example: Transformation 1: Swaps two rows in the same quadrants 1243 4321 3412 Transformation 4: Swaps the left and right quadrant columns entirely 4312 2143 1234 3421


We have an Answer from Expert

View Expert Answer

Expert Answer




We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe