CMPT 14x Fall 2008 Extra HW/Lab Assignments

Most homework and lab assignments are taken from the M2 textbook. This page lists the assignments not from the M2 textbook.

Lab08: due Wed 19 Nov / Thu 20 Nov

Complete one of Lab04-07 in Modula-2, with a full lab write-up. Some labs gave you a choice of problems; you need not choose the same problem, but you may. You may reuse parts of your old lab write-up if appropriate, although some refinements of your pseudocode may need to be revisited before you start your M2 code. You may wish to refer to the Stonybrook M2 tutorial and the M2 text.

HW08: due Mon 24 Nov

Calculate a knight's tour for a 3x4 board, starting at the corner (0,0). In addition to the completed board, also show all your backtracking, using a tree diagram or a list of moves or whatever you see fit.

Lab09: due Wed 26 Nov / Thu 27 Nov

Write a library that provides robust user input:
For each basic Python data type (int, float, bool, str), provide a function that reads input from the keyboard and returns the value in the proper type. E.g., input_str(), input_bool(), etc.

Lab10: due Wed 3 Dec / Thu 4 Dec

Write a Python program to calculate a knight's tour of an arbitrary-size board, given the dimensions of the board and the starting position.

References you may find useful (cite them in your lab write-up if you use them):