| You really don't want to think of this in terms of IF ... THEN ... ELSE but as individual binary or multi-path choices. These are most efficiently handled with hash tables that choose a route through a logic diagram in a way that is more intuitive than If ... THEN ... ELSE as well as more efficient. You start by writing a logic flowchart that you understand, then you reduce the logic flowchart to code, usually automatically. This is how a logic flowchart looks: http://en.wikipedia.org/wiki/File:LampFlowchart.svg Here is the article it appears in: http://en.wikipedia.org/wiki/Flowchart The single most important parts of this process are: 1. That you understand the logic diagram and see that it meets the program's requirements. 2. That there is a way to turn the logic flowchart into code, ideally without human intervention. 3. That the rebuild time be short between adding a new logical step and testing the resulting program. |