Computer Science in Algebra
Contracts
Understanding what functions should do and how to make them do it
Vocab
What's in a Function?
Signing the Contract
The 3 Parts of a Contract
We write contracts in the form:
Name: Domain -> Range
Contract Examples
+: Number Number -> Number
triangle: Number String String -> Image
rotate: Number Image -> Image
Writing Contracts
Contracts from Blocks
Keep up your Contracts
As you continue programming, make sure you write a contract for every new function you encounter or write!