The problem set was very straightforward. Probably one of the easier ones so far but it's always the stupid silly mistakes that make me lose marks. The only difficulties I encountered are determining what is a sufficient for these (non-numerical) proofs. I find I have to define what something like
# Postcondition: revString(s) returns a string with
# the characters of s in reverse order.
What does reverse order mean? If I am the one deciding it, can I just say reverse order is defined as:
revString(s[1:]) + s[0]
No comments:
Post a Comment