|
CSC324H Programming Languages Fall 2009 -- Assignments |
|
All assignments should be done individually, no group works. Please check the course policy for general discussion.
Clarifications:
Question 4:
Due date extended: Please the due date Assignment 2 will be Oct. 10, 2009 (6:00pm sharp) .
All assignments should be done individually, no group works. Please check the course policy for general discussion.
Assignment Cover Page You may type your name on the line of signature if you don't have a scannar or e-signature.
Before start your assignment, please read the coding guidelines and follow this guideline document for testing.
Electronic submission
Only plain text submissions will be graded. It is your responsibility to ensure that your submission is readable. You should not have any lines longer than 81 characters. Unreadable work will not be graded.
Assignment submission website.
Clarifications:
Question 5:
Due date extended: Please the due date Assignment 3 will be Nov 2, 2009 (6:00pm sharp) .
Assignment Cover Page You may type your name on the line of signature if you don't have a scannar or e-signature.
There will be two parts in this assignment.
Before start your assignment, please read the coding guidelines and follow this guideline document for testing.
Electronic submission
Only plain text (for programming) and pdf (for written assignment) submissions will be graded. It is your responsibility to ensure that your submission is readable. You should not have any lines longer than 81 characters. Unreadable work will not be graded.
Assignment submission website.
Clarifications/Correction:
>(pairs '() '(1 2 3))
()
>(pairs '(1 2 3) '())
()
> (tree-height1 (leaf 3))
1
> (tree-height1 (node (leaf 3)
(node (leaf 4)
(leaf 5))))
3
> (tree-yield1 (leaf 1)))
(1)
> (tree-yield1 (node (leaf 1) (leaf 2)))
(1 2)
> (tree-yield1 (node (leaf 1)
(node (leaf 3) (leaf 2))))
(1 3 2)
> (tree-yield1 (node
(node (leaf 3) (leaf 4))
(leaf 1)))
(3 4 1)
(match (div (num 2) (num 5))
((add x y) x)
((div x y) (list x y))
((num x) x)) => ((num 2) (num 5))
Assignment Cover Page You may type your name on the line of signature if you don't have a scannar or e-signature.
There will be two parts in this assignment.
Before start your assignment, please read the description carefully in the assignment, and follow this guideline document for testing.
Electronic submission
Only plain text (for programming) and pdf (for written assignment) submissions will be graded. It is your responsibility to ensure that your submission is readable. You should not have any lines longer than 81 characters. Unreadable work will not be graded.
Assignment submission website.
Clarifications/Correction:
?- unique([a,b,b,a,c],[b,a,c]). true. ?- unique([b,a,[b,b],b], K). Y = [a,[b,b],b]; false. You may use predicate not/1. Bonus (5 points): Note that in the above example, unique([a,b,b,a,c], Y) is true iff Y=[b,a,c]. If you could implement unique(+List,?Set), so that unique([a,b,b,a,c], Y) will be true iff Y is a collection of a, b and c no matter which order they are in. For example, ?- unique([a,b,b,a,c],[b,a,c]). true. ?- unique([a,b,b,a,c],[a,b,c]). true. ?- unique([a,b,b,a,c],[b,c,a]). true. ?- unique([a,b,b,a,c],[b,b,a,c]). false.
?-[movies, a4].
Assignment Cover Page You may type your name on the line of signature if you don't have a scannar or e-signature.
There will be two parts in this assignment.
Before start your assignment, please read the description carefully in the assignment, and follow this guideline document for testing.
Electronic submission
Only plain text (for programming) and pdf (for written assignment) submissions will be graded. It is your responsibility to ensure that your submission is readable. You should not have any lines longer than 81 characters. Unreadable work will not be graded.
Assignment submission website.
Clarifications/Correction:
Yilan Gu ©2009, University of Toronto