Haskell代写 | CMT304 Programming Paradigms


This assignment is worth of the total marks available for this module. If coursework is
submitted late (and where there are no extenuating circumstances):

1. If the assessment is submitted no later than 24 hours after the deadline, the mark for
the assessment will be capped at the minimum pass mark;

2. If the assessment is submitted more than 24 hours after the deadline, a mark of 0 will
be given for the assessment.

Your submission must include the official Coursework Submission Cover sheet, which can
be found here:

Submission Instructions

All submissions must be via Learning Central. Upload the following files in a single zip file,

Description Type Name

Cover Sheet Compulsory One PDF (.pdf) file

Task 1 Compulsory One source file

Task 2 Compulsory One PDF (.pdf) file

Any deviation from the submission instructions above (including the number and types of
files submitted) will result in a mark of zero for the assessment or question part.

Staff reserve the right to invite students to a meeting to discuss coursework submissions.

Your submissions will be checked for plagiarism. Your work must be your own and
you must independently solve the problem and submit your own solution. Any other
material or sources of information you use must be referenced. Code and text you
submit will be compared with other submissions and various other sources on and
off the Internet. Any substantial similarities of your submission to unreferenced work
or material not created by yourself will be subject to academic misconduct proce-
dures. Marks will only be assigned for work you have done yourself (incl. finding and

discussing material from references, but not the referenced work; there are no marks
for code copied from elsewhere, but for either writing your own code or integrating
and adapting code that you have not written).


This is assignment two of a portfolio that will be composed of four assignments. Each of
the four assignments is worth , summing up to of the total marks available for this


Consider the problem of solving a Sudoku puzzle. It is played on a grid consisting of
cells subdivided into four squares as shown in the figure below. Some of the cells
are empty, some of them are filled with digits from through . The aim is to fill in the empty
cells such that every row, every column, and every square contains the digits , , , .

Write an efficient Haskell function that can solve this problem. Its input is a matrix, repre-
sented as a list of rows, where each row is a list of the numbers in the grid. The numbers
are either , , , if the field is filled or if the field is empty. The output of the function
should be one solution to the problem, in the same matrix format with the values replaced
by a number to (or an error message if the input has no valid solution). For example, for
the above grid, the input is

and one solution is

Make sure you clearly document your approach and how to use your function in the com-