Question: Task 8: Complete the following function template: function MAKESOLUTION(row) end function This function will take the four-element vector row as input, which is the same


Task 8: Complete the following function template: function MAKESOLUTION(row) end function This function will take the four-element vector row as input, which is the same input for the function MAKEVEC- TOR. The function should return a solved Pseudoku puzzle such that all column and sub-grid Pseudoku conditions are satisfied. The function will generate a vector using MAKEVECTOR(row), then try cyclic permutations on this vector using PERMUTEROW(puzzle, x, y, z) until a set of permutations is found such that all Pseudoku conditions are satisfied (checked using CHECKGRIDS and COLCHECK). To be able to get full marks you should call the functions MAKEVECTOR, PERMUTEROW, CHECKGRIDS and COLCHECK. [6 marks] All of the methods above will just produce a solved Pseudoku puzzle. In order to produce a proper Pseudoku puzzle, numbers will need to be removed from the output of MAKESOLUTION and replaced with a blank character. To complete the algorithm for generating Pseudoku puzzles, in addition to the input vector row, we have the integer n, which will stipulate the number of blank entries in the final puzzle. The puzzle format As mentioned earlier, we will start with a completed puzzle stored in a four-element vector called puzzle where every element is itself a four-element vector, such as 2 41 3 1 3 2 4 3 2 4 1 4 1 3 2 Each row of the puzzle will correspond to an element of a vector, e.g. the first row of the Pseudoku puzzle will be stored as a four-element vector, which itself is an element of a four-element vector. Therefore, this completed Pseudoku puzzle is represented by the following vector: Element1 Element 2 Elements Element 4 We could make this vector by initiating a four-element vector, with each element being empty, and then assign a vector to each element. The goal of the algorithm in this coursework is to generate an unsolved Pseudoku puzzle from a row of four numbers. The first step in the process is to make all four elements of a four-element vector to be the same, and this element will be a four-element vector. For example, given a four-element vector with the numbers 2, 4, 1, 3, we produce the following vector: Element1 Element 2 Element 3 Element 3 Your first task is to write a function in pseudocode that will carry out this process
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
