Re: 3-D Programming Logic

by "Darrell King" <darrell(at)webctr.com>

 Date:  Sun, 16 Apr 2000 10:07:51 -0400
 To:  "HWG Techniques" <hwg-techniques(at)hwg.org>
 References:  brightmail
  todo: View Thread, Original
scoring:

$points=0;

if ($variable1 == TRUE) { $points ++; }
if ($variable2 == TRUE) { $points ++; }
if ($variable3 == TRUE) { $points ++; }

if ($points >1) { do something }

This will execute your code for any 2 of three.

---------
Disclaimer: this next is simplified, and I am not a CS engineer.

You need to remember when concieving your code that a computer is only
capable of determining "yes" or "no".  The essence is in the binary
foundations of computing: 1 or 0.  In order to achieve any result, a
computer simply progresses sequentially through a series of "true" or
"false" decisions that eventually lead it to the end of the code.

Conceptually, this is evident in any menuing system:

1) Click here for this page
2) Click here for this page
3) Click here for this page

That isn't really three choices to the computer!  Its actually two choices
for each selection, taken in sequence: it checks #1 one, and the decision is
either "it was clicked" or "it wan't clicked".  The actions are "if clicked,
go to page one"..."if not clicked, go to next menu item and repeat this
check".

All computing is based on this concept of "go left" or "go right".  The most
complicated graphical programs in existance are based on this methodical
processing of two choices.

The only advantage the computer has over our far more flexible brains is
that it can process these yes-no decisions incredibly fast, giving the
illusion of far more flexibility than is actually present.  So, your grasp
of the languages as "2 dimensional" was, IMHO, fairly perceptive...:).

D

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA