Sample solutions and grading discussion:
(a) was worth five out of the eight marks.
In that term, given that assignment four, I wrote
in detail about the sorting algorithm in
insertionsort.html,
so I'll let that page speak to the answer here.
Although in grading, pretty
much any description of some major parts of the algorithm was accepted.
And no python code was required.
For part (b), you did not need to write correct python code for the list
manipulation, but you did have to answer the question (as opposed to writing
code or parts of code which did something else).
The three points in grading were:
-
gamestate[0]
-
if
... == 0
, and the structure via indentation
(I accepted "=" for "==" without comment)
- removing the item -- graded extremely leniently, but you did have to
write something implying a modification of the "gamestate" variable.
Also, there was a deduction if you put some elements of the above inside a
loop of some kind.
(press 'back' in your web browser to get back to where you were in the exam)