by V. Anton Spraul
Thinking about the problem can be more procuctive than thinking about the solution.
- If you are unaware of all possible actions you could take, you may be unable to solve the problem
- Restating the problem in more formal terms, we can often uncover solutios that would have otherwise eluded us.
* Try to make operations generic or parameterized: From the Riddle
1. Operation: Carry the fox to the far side of the river.
2. Operation: Carry the goose to the far side of the river.
3. Operation: Carry the corn to the far side of the river.
Becomes:
1. Operation: Row the boat from one shore to the other.
2. Operation: If the boat is empty, load an item from the shore.
3. Operation: If the boat is not empty, unload the item to the shore.
Sliding Tiles Puzzle
We are sometimes faced with situations where we can't see a clear path to code the solutino, but we must never allow this to be an excuse to gorgo planning an systematic apporaches. It's better to develop a strategy than to attack the problem through tiral and error. The author developed the "train" technique from fiddling around with a 2x3 puzzle instead of the original 3x3 puzzle.
Sometimes problems are divisible in ways that are not obvious.
How would I describe my fidiling around solution of the 3x3 puzzle?