Pitcher Problems: A Case Study in Using Search Trees
The problem
First: Do it by hand
Second: Notice what you did
Third: Identify the problem type
Formalize the Algorithm
Pseudocode
An edge case leads to a refinement
Towards Python: A little OOP
Further towards Python: Pseudocode translation
Debugging
is_goal()
Interlude: Bitwise operations (really just
&
)
Back to our program:
is_goal()
Final program