Question
We now have all the ingredients to generate a solved puzzle given a row vector called row. The next task will involve generating the initial
We now have all the ingredients to generate a solved puzzle given a row vector called row. The next task will involve generating the initial four-element vector called puzzle from row using MakeVector(row ), trying all cyclic permutations (using PermuteRow(puzzle, x, y, z) for all combinations of x, y and z) to see if the returned vector returns TRUE for both CheckGrids and ColChecks. 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 MakeVector. 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.
THE ANSWER HAS TO BE IN PSEUDOCODE. NO OTHER FORM IS ACCEPTED.
To see the other functions, please go to this link: https://www.chegg.com/homework-help/questions-and-answers/cyclically-permute-values-repeat-multiple-times-process-enqueueing-value-head-dequeueing-f-q90835464?trackid=abefxIY4
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started