[Reader-list] Alternative software???

Supreet Sethi supreet at sdf.lonestar.org
Tue Dec 3 11:57:05 IST 2002


It just struck me that to implement this code you would need to modify the 
mathematics, that is basic operators to your choice of language, that is 
1+1 should'nt evaluate to 2.

Lets make a assumption that there is this clan or a tribe which uses 
alternate form of mathematics. This kind of alternate mathematics could be 
implemented like this.


#include <iostream>
using namespace std;

class alternativeMathematics
{
private:
  int almv;
public:
  alternativeMathematics(int val)
  {
    almv=val;
  }

  friend int operator+( alternativeMathematics &t1,  
alternativeMathematics &t2)
  {
    return t1.val();
  }

  friend int operator-( alternativeMathematics &t1, alternativeMathematics 
&t2)
  {
    return t1.val()+t2.val();
 }

  int val()
  {
    return almv;
  }

};

int main()
{
  alternativeMathematics a(1),b(1),c(0);
  cout << a-b<<endl;
  cout << a+b<<endl;
}


modify main() function to implment if-then-else/not operation.


In this  program 1+1 = 1 and 1-1 evalautes to 2



Sorry dunno how to implement this in VB. You would need a ISO/C++ compiler 
to compile this snippet


On Mon, Dec 02, 2002 at 01:35:39PM -0500, Are Flagan wrote:
> On 12/2/02 9:49, "Pankaj Kaushal" <pankaj at sarai.net> wrote:
> 
> > 1+1=2 can i question that?
> 
> On enterQuestion
> Global ganswer
> If 1+1=2 then ganswer = FALSE
> Else if 1+1=1 then gvanswer = TRUE
> End if
> updateStage
> End enterQuestion
> 
> 
> 
> 
> 
> 
> _________________________________________
> reader-list: an open discussion list on media and the city.
> Critiques & Collaborations
> To subscribe: send an email to reader-list-request at sarai.net with subscribe in the subject header.
> List archive: <https://mail.sarai.net/pipermail/reader-list/>

-- 
supreet at sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org



More information about the reader-list mailing list