OMGWTF programming contest

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

OMGWTF programming contest

Postby plams » Mon Apr 30, 2007 4:46 pm UTC

The Olympiad of Misguided Geeks contest at Worse Than Failure.

Basically you can win a MacBook Pro if you write a 4-function calculator. However, you have to impress the judges by writing truly awful code. If you can make somebody go 'WTF?!', and even laugh, when they look at your code you're probably on right track.

One of my ideas that I'm probably not going to use since it's too obvious is to pipe your input through Google Calculator and print the result.
plams
 
Posts: 35
Joined: Fri Oct 13, 2006 12:08 am UTC
Location: denmark

Postby EvanED » Mon Apr 30, 2007 5:06 pm UTC

What? Why are you announcing this? Don't you know that the more people enter the lower our chances will be? ;-)
EvanED
 
Posts: 3767
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Postby plams » Mon Apr 30, 2007 5:15 pm UTC

But the more hillarious the winning entry will be!

Actually.. I think the worst part about this thread is that no one will reveal their genius ideas in fear of IP theft. Maybe we can share our ideas after the deadline at may 14.
plams
 
Posts: 35
Joined: Fri Oct 13, 2006 12:08 am UTC
Location: denmark

Postby evilbeanfiend » Mon Apr 30, 2007 5:31 pm UTC

Code: Select all

int doAdd(int lhs, int rhs)
{
  int result=lhs;
  for(int i=0;i<rhs;++i)
  {
    ++result;
  }
  return result
}

int DoMult(int lhs, int rhs)
{
  int result=lhs
  for(int i=0;i<rhs;++i)
  {
    result = DoAdd(result,lhs);
  }
  return result
}



as a start. but im sure many layers of wtf will be required.
in ur beanz makin u eveel
User avatar
evilbeanfiend
 
Posts: 2650
Joined: Tue Mar 13, 2007 7:05 am UTC
Location: the old world

Postby hotaru » Mon Apr 30, 2007 6:02 pm UTC

i can do better than that...
Code: Select all
int doAdd(int lhs,int rhs){
 for(;rhs>0;rhs=~-rhs)lhs=-~lhs;
 for(;rhs<0;rhs=-~rhs)lhs=~-lhs;
 return lhs;
}
User avatar
hotaru
 
Posts: 931
Joined: Fri Apr 13, 2007 6:54 pm UTC

Postby Yakk » Mon Apr 30, 2007 6:06 pm UTC

Code: Select all
template<int n, int m, int base>
struct add {
  enum {
    result = (n+m)%base,
    carry = ((n+m)/base)?1:0
  };   
};

template<int base>
struct add_work {
  template<int n>
  struct arg_1 {
    template<int m>
    struct arg_2 {
      enum {
        upper = add_work<base>::arg_1<n/base>::arg_2<m/base>::result,
        carry = add<n%base, m%base, base>::carry,
        lower = add<n%base, m%base, base>::result,
        result = base*(upper+carry)+lower,
      };
    }
    template<>
    struct arg_2<0> {
      enum {result = n};
    }
  }
  template<>
  struct arg_1<0> {
    template<typename m>
    struct arg_2 {
       enum {result = m};
    };
  };
};

template<int base, int n, int m>
struct adder {
  enum{result=add_work<base>::arg_1<n>::arg_2<m>::result};
};


Write up the calculator using silly template metaprogramming.

Have your calculator take the expression, then use preprocessor macros to compile the template metaprogramming programs with -define flags.

Extract out from the resulting binary the value of the result without running it, as it will be a compile-time constant.

Return the constant.
User avatar
Yakk
 
Posts: 10039
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

Postby plams » Mon Apr 30, 2007 6:08 pm UTC

I'll raise you a

Code: Select all

int doAdd(int lhs, int rhs)
{
  int result=lhs;
  while(result<(lhs+rhs))
  {
    ++result;
  }
  return result;
}
int DoMult(int lhs, int rhs)
{
  if(rhs > lhs)
  {
    // exploit commutative property
    return DoMult(rhs,lhs);
  }
  else
  {
    return lhs*rhs;
  }
}
plams
 
Posts: 35
Joined: Fri Oct 13, 2006 12:08 am UTC
Location: denmark

Postby HiEv » Mon Apr 30, 2007 8:39 pm UTC

If it were legal, I'd be tempted to write C++ code that outputs, compiles, and runs Pascal code to find the answer, and then returns that. :twisted:
The difference between intelligence and stupidity is that intelligence has its limits.
User avatar
HiEv
 
Posts: 37
Joined: Wed Apr 11, 2007 7:45 am UTC

Postby evilbeanfiend » Tue May 01, 2007 8:56 am UTC

exploiting the commutativity is nice but your function looks like it is going to end up being more efficient then the previous ones. ideally we want addition and multiplication to be worse than O(n) though which seems hard without putting in gratuitously useless steps (bogo sort to get the answer maybe?).
in ur beanz makin u eveel
User avatar
evilbeanfiend
 
Posts: 2650
Joined: Tue Mar 13, 2007 7:05 am UTC
Location: the old world

Postby Yakk » Tue May 01, 2007 1:22 pm UTC

evilbeanfiend wrote:exploiting the commutativity is nice but your function looks like it is going to end up being more efficient then the previous ones. ideally we want addition and multiplication to be worse than O(n) though which seems hard without putting in gratuitously useless steps (bogo sort to get the answer maybe?).


O(n lg n): Increment bitwise manually.

O(n e^n): Randomly search integers until you find the one that is 1 greater than your target number.

O(e^e^n): Randomly search integers until you find the one that is 1 greater than your target number. Restart entire calculation if you make any error anywhere.
User avatar
Yakk
 
Posts: 10039
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

Postby evilbeanfiend » Tue May 01, 2007 1:32 pm UTC

Yakk wrote:
evilbeanfiend wrote:exploiting the commutativity is nice but your function looks like it is going to end up being more efficient then the previous ones. ideally we want addition and multiplication to be worse than O(n) though which seems hard without putting in gratuitously useless steps (bogo sort to get the answer maybe?).


O(n lg n): Increment bitwise manually.

O(n e^n): Randomly search integers until you find the one that is 1 greater than your target number.

O(e^e^n): Randomly search integers until you find the one that is 1 greater than your target number. Restart entire calculation if you make any error anywhere.


the second two was pretty much what i was thinking when i said bogo sort - extra trickness should be in the target matching methnks
in ur beanz makin u eveel
User avatar
evilbeanfiend
 
Posts: 2650
Joined: Tue Mar 13, 2007 7:05 am UTC
Location: the old world

Postby hotaru » Tue May 01, 2007 2:02 pm UTC

Code: Select all
#define _ rhs--
int DoAdd(int lhs,int rhs){
 if(!lhs)return rhs;
 if(rhs&(1<<31))return -DoAdd(-lhs,-rhs);
 for(;_;)lhs*=-(float)~lhs/lhs;
 return lhs;
}
int DoMult(int lhs,int rhs){
 int result=0;
 for(;_;)result=DoAdd(result,lhs);
 return result;
}
User avatar
hotaru
 
Posts: 931
Joined: Fri Apr 13, 2007 6:54 pm UTC

Postby EvanED » Tue May 01, 2007 2:27 pm UTC

Personally, I like this solution:

Code: Select all
const int DIM = 600000;
const int FIELD_WIDTH = 6;
char buf[FIELD_WIDTH + 1] = { 0 };

fd = fopen("add.dat");
fseek(fd, FIELD_WIDTH * (DIM * x + y) );
fread(fd, buf, FIELD_WIDTH);
ans = atoi(buf);


The problem is that this would have to come with an 8 TB database of answers, as it needs to work with numbers up to 500,000-some in both positions.
EvanED
 
Posts: 3767
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Postby hotaru » Tue May 01, 2007 2:37 pm UTC

EvanED wrote:The problem is that this would have to come with an 8 TB database of answers, as it needs to work with numbers up to 500,000-some in both positions.

actually, it only needs to work with the test cases listed here.
and only in that order... so actually you could just have it display those answers in that order, one each time "=" is pressed, and it would be correct for that contest. it's only required to display the results on the screen (you don't have to display the numbers as they're entered) and those are the only test cases that will be used, so you can just ignore all the other buttons...
User avatar
hotaru
 
Posts: 931
Joined: Fri Apr 13, 2007 6:54 pm UTC

Postby EvanED » Tue May 01, 2007 2:45 pm UTC

hotaru wrote:
EvanED wrote:The problem is that this would have to come with an 8 TB database of answers, as it needs to work with numbers up to 500,000-some in both positions.

actually, it only needs to work with the test cases listed here.
and only in that order... so actually you could just have it display those answers in that order, one each time "=" is pressed, and it would be correct for that contest. it's only required to display the results on the screen (you don't have to display the numbers as they're entered) and those are the only test cases that will be used, so you can just ignore all the other buttons...


Yes, but that destroys the elegance of my solution. ;-)
EvanED
 
Posts: 3767
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Postby Andrew » Tue May 01, 2007 2:56 pm UTC

hotaru wrote:actually, it only needs to work with the test cases listed here.
and only in that order... so actually you could just have it display those answers in that order, one each time "=" is pressed, and it would be correct for that contest.

Yeah, I think that kind of detracts from the fun of it. It seems like it'd be much better to produce a working calculator that operated on an insane system than produce something that'd throw up a set list of numbers by any system. I hope the winner is a proper calculator.
User avatar
Andrew
 
Posts: 619
Joined: Tue Jan 02, 2007 9:59 pm UTC
Location: Manchester, UK

Postby evilbeanfiend » Tue May 01, 2007 3:08 pm UTC

yes i agree, i also think that adding any operation that a modern compiler can just elide should not be included in the winner. we want wtfery that cant be fixed by simply selecting and deleting some preamble.
in ur beanz makin u eveel
User avatar
evilbeanfiend
 
Posts: 2650
Joined: Tue Mar 13, 2007 7:05 am UTC
Location: the old world

Postby Yakk » Tue May 01, 2007 3:14 pm UTC

We could view the + and * operations as unknown functions, and do analysis to determine what the correct result would be.

Heck, we could solve the problems in the frequency domain.
User avatar
Yakk
 
Posts: 10039
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

Postby evilbeanfiend » Tue May 01, 2007 3:17 pm UTC

and store all the numbers internally in a strange base.
in ur beanz makin u eveel
User avatar
evilbeanfiend
 
Posts: 2650
Joined: Tue Mar 13, 2007 7:05 am UTC
Location: the old world

Postby Andrew » Tue May 01, 2007 3:38 pm UTC

If it integer only was acceptable I'd love to store all numbers as arrays of prime factors. That'd give great multiplication and division routines, and I'd be interested to know if addition could be done without conversion back to numbers (which would ideally only be done by the display routine). I suppose you could count "-1" as prime for the sake of negative numbers.

But I don't think you could shoehorn decimals into there, so that'd kill it.
User avatar
Andrew
 
Posts: 619
Joined: Tue Jan 02, 2007 9:59 pm UTC
Location: Manchester, UK

Postby evildave » Tue May 01, 2007 4:49 pm UTC

Format the arguments into the command line for the 'infamous sed calculator', then invoke sed and wait for the result, then take that result and make a number out of it again.

http://www.npcguild.org/~ksb/hack/math.sed
evildave
 
Posts: 77
Joined: Wed Apr 25, 2007 3:52 am UTC

Postby Yakk » Tue May 01, 2007 4:59 pm UTC

Just keep track of where the decimal point is is.

You can do finite-decimal math using integers pretty damn well.
User avatar
Yakk
 
Posts: 10039
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

Postby EvanED » Tue May 01, 2007 5:43 pm UTC

I can't think of any way to do addition with sets of factors though, besides either converting back to integers or special casing it.
EvanED
 
Posts: 3767
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Postby tendays » Tue May 01, 2007 6:04 pm UTC

Something like this would be a start:

Code: Select all
int mult(int a,int b) {
int r=0;
for (int i=0;i<a;i++) {
r += b;
}
return r;
}

(is it supposed to work with negative numbers, too?)
That was the easy part. Then:
Code: Select all
int sum(int a,int b) {
int c=mult(1<<a,1<<b);
for (int r=0;c;r++) c>>1;
return r;
}

(That's the general idea - I tried to put myself in the mind of a wtf-generating person)
(would probably have to generalise the multiplication operator to work on large numbers)
User avatar
tendays
 
Posts: 945
Joined: Sat Feb 17, 2007 6:21 pm UTC
Location: INDIA

Postby Scarblac » Tue May 01, 2007 10:21 pm UTC

tendays wrote:(That's the general idea - I tried to put myself in the mind of a wtf-generating person)
(would probably have to generalise the multiplication operator to work on large numbers)

No no no, that would be improving your code :-)

If it fails some tests, you can always add special cases for each. Or something.
Scarblac
 
Posts: 43
Joined: Wed Feb 28, 2007 11:39 am UTC

Postby Andrew » Tue May 01, 2007 10:27 pm UTC

tendays wrote:Something like this would be a start:

Code: Select all
int mult(int a,int b) {
int r=0;
for (int i=0;i<a;i++) {
r += b;
}
return r;
}

(is it supposed to work with negative numbers, too?)


More to the point, that doesn't work on non-integers.

Imagine how beautiful the code would be with interpolation.

Even in
Code: Select all
int add(int a,int b) {
int r=0;
for (int i=0;i<a;i++) {
r ++;
}
for (int i=0;i<b;i++) {
r ++;
}
return r;
}

...you do it twice and take a weighted average. And the results would be bang on, too.
User avatar
Andrew
 
Posts: 619
Joined: Tue Jan 02, 2007 9:59 pm UTC
Location: Manchester, UK

Postby Hamorad » Sat May 05, 2007 3:25 am UTC

This looks fun

Code: Select all
int doAdd(int lhs, int rhs)
{

bool a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,flase,ture;int x,y,z; for(z=0;x<89430;y++--)a=false;b=true;c=true;d=a;a=c; d=b;b=k;n=o;o= a;flase=true;ture=i; i=l;e=f;l=s;q=r;r=q;s=n;o =o;q=r;d=e; flase= ture;i=q;n=o; j=s;h=j;j=i;if (r==q)z=12; r=s; x += z+1020;j =k;n=q;x=y; ture=g;h=flase;int result=lhs;x=y;z=q;l=m;e=d;h=i;ture =a;a=true;ture=a;b= flase;while(result<(lhs+rhs))++result;flase=true;ture=i; i=l;e=f;l=s;q=r;r=q;s=n;o=o;!r;q=r;x=900494;/*return result;*/q=r;r=q;s=n;o =o;q=r;d=e;d=b;b=k;n=o;o= a;flase=true;ture=i; i=l;e=f;l=s;!n;q=r;r=q;s=n;o =o;q=r;d=e; flase= ture;i=q;n=o; j=s;h=j;j=i;if (r==q)z=12; r=s; x += z+1020;j =k;n=q;x=y; ture=g;h=flase;/*icecreamgoeshere=s*/e=f;l=s;q=r;r=q;s=n;o i=l;e=f;l=s;q=r;r=q;s=n;o =o;q=r;d=e; flase= ture;i=q;n=o; j=s;h=j;j=i;if (r==q)z=12;=o;q=r;d=e; flase= ture; for(double kfol = 3.84590; x< 0289;x--+++++++-);flase=true;ture=i; i=l;e=f;l=s;q=r;r=q;s=n;o =o;q=r;x=900494;return result;q=r;r=q;s=n;o =o;q=r;q=s;r=p;n=o;d=e;d=b;b=k;n=o;o= a;flase=true;ture=i; i=l;e=f;z=0;!q;l=s;q=r;r=q;s=n;o =o;q=r;

return result;
}


There are some errors in there - I'm aware of that... but it's late, I don't feel like looking for them, and ugh. Pah.
User avatar
Hamorad
 
Posts: 105
Joined: Fri Sep 29, 2006 7:14 pm UTC

Postby Hex » Sat May 05, 2007 4:23 am UTC

I hope to enter when I get an idea clever enough :? .
Hex
 
Posts: 67
Joined: Sat Apr 07, 2007 10:07 pm UTC

Postby Taejo » Sat May 05, 2007 11:32 am UTC

Hex wrote:I hope to enter when I get an idea clever enough :? .


It's probably best to get started while you're still clueless.
Indiscreet Mathematics, a comic about maths
User avatar
Taejo
 
Posts: 60
Joined: Wed Oct 11, 2006 8:00 am UTC

Re: OMGWTF programming contest

Postby umbrae » Sat May 05, 2007 3:14 pm UTC

plams wrote:One of my ideas that I'm probably not going to use since it's too obvious is to pipe your input through Google Calculator and print the result.


Plams, an idea for you:

Pipe your input through all three of the major search engines: google, yahoo, and live. (They all do calculator stuff).

If they don't end up having the same answer, return "I don't know" :P

Edit: I might end up doing this myself.
Last edited by umbrae on Mon May 07, 2007 2:26 am UTC, edited 1 time in total.
User avatar
umbrae
 
Posts: 336
Joined: Sat Sep 09, 2006 2:44 pm UTC

Postby Strilanc » Mon May 07, 2007 12:11 am UTC

The winning code should definitely have "estimate" somewhere in the comments, preferably in the integer addition part.
Don't pay attention to this signature, it's contradictory.
User avatar
Strilanc
 
Posts: 646
Joined: Fri Dec 08, 2006 7:18 am UTC

Postby parallax » Tue May 08, 2007 6:10 am UTC

Andrew wrote:If it integer only was acceptable I'd love to store all numbers as arrays of prime factors. That'd give great multiplication and division routines, and I'd be interested to know if addition could be done without conversion back to numbers (which would ideally only be done by the display routine). I suppose you could count "-1" as prime for the sake of negative numbers.

But I don't think you could shoehorn decimals into there, so that'd kill it.


Allow your prime factors to have negative exponents. Then you can handle all rational numbers.

I don't think there are any good addition routines, however.
User avatar
parallax
 
Posts: 157
Joined: Wed Jan 31, 2007 5:06 pm UTC
Location: The Emergency Intelligence Incinerator

Postby adlaiff6 » Tue May 08, 2007 7:50 am UTC

Hamorad wrote:This looks fun

Code: Select all
int doAdd(int lhs, int rhs)
{

bool a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,flase,ture;int x,y,z; for(z=0;x<89430;y++--)a=false;b=true;c=true;d=a;a=c; d=b;b=k;n=o;o= a;flase=true;ture=i; i=l;e=f;l=s;q=r;r=q;s=n;o =o;q=r;d=e; flase= ture;i=q;n=o; j=s;h=j;j=i;if (r==q)z=12; r=s; x += z+1020;j =k;n=q;x=y; ture=g;h=flase;int result=lhs;x=y;z=q;l=m;e=d;h=i;ture =a;a=true;ture=a;b= flase;while(result<(lhs+rhs))++result;flase=true;ture=i; i=l;e=f;l=s;q=r;r=q;s=n;o=o;!r;q=r;x=900494;/*return result;*/q=r;r=q;s=n;o =o;q=r;d=e;d=b;b=k;n=o;o= a;flase=true;ture=i; i=l;e=f;l=s;!n;q=r;r=q;s=n;o =o;q=r;d=e; flase= ture;i=q;n=o; j=s;h=j;j=i;if (r==q)z=12; r=s; x += z+1020;j =k;n=q;x=y; ture=g;h=flase;/*icecreamgoeshere=s*/e=f;l=s;q=r;r=q;s=n;o i=l;e=f;l=s;q=r;r=q;s=n;o =o;q=r;d=e; flase= ture;i=q;n=o; j=s;h=j;j=i;if (r==q)z=12;=o;q=r;d=e; flase= ture; for(double kfol = 3.84590; x< 0289;x--+++++++-);flase=true;ture=i; i=l;e=f;l=s;q=r;r=q;s=n;o =o;q=r;x=900494;return result;q=r;r=q;s=n;o =o;q=r;q=s;r=p;n=o;d=e;d=b;b=k;n=o;o= a;flase=true;ture=i; i=l;e=f;z=0;!q;l=s;q=r;r=q;s=n;o =o;q=r;

return result;
}


There are some errors in there - I'm aware of that... but it's late, I don't feel like looking for them, and ugh. Pah.


If only you used all those variables.
3.14159265... wrote:What about quantization? we DO live in a integer world?

crp wrote:oh, i thought you meant the entire funtion was f(n) = (-1)^n
i's like girls u crazy
User avatar
adlaiff6
 
Posts: 274
Joined: Fri Nov 10, 2006 6:08 am UTC
Location: Wouldn't you rather know how fast I'm going?

Postby evilbeanfiend » Tue May 08, 2007 9:53 am UTC

Hamorad wrote:This looks fun

Code: Select all
int doAdd(int lhs, int rhs)
{

bool a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,flase,ture;int x,y,z; for(z=0;x<89430;y++--)a=false;b=true;c=true;d=a;a=c; d=b;b=k;n=o;o= a;flase=true;ture=i; i=l;e=f;l=s;q=r;r=q;s=n;o =o;q=r;d=e; flase= ture;i=q;n=o; j=s;h=j;j=i;if (r==q)z=12; r=s; x += z+1020;j =k;n=q;x=y; ture=g;h=flase;int result=lhs;x=y;z=q;l=m;e=d;h=i;ture =a;a=true;ture=a;b= flase;while(result<(lhs+rhs))++result;flase=true;ture=i; i=l;e=f;l=s;q=r;r=q;s=n;o=o;!r;q=r;x=900494;/*return result;*/q=r;r=q;s=n;o =o;q=r;d=e;d=b;b=k;n=o;o= a;flase=true;ture=i; i=l;e=f;l=s;!n;q=r;r=q;s=n;o =o;q=r;d=e; flase= ture;i=q;n=o; j=s;h=j;j=i;if (r==q)z=12; r=s; x += z+1020;j =k;n=q;x=y; ture=g;h=flase;/*icecreamgoeshere=s*/e=f;l=s;q=r;r=q;s=n;o i=l;e=f;l=s;q=r;r=q;s=n;o =o;q=r;d=e; flase= ture;i=q;n=o; j=s;h=j;j=i;if (r==q)z=12;=o;q=r;d=e; flase= ture; for(double kfol = 3.84590; x< 0289;x--+++++++-);flase=true;ture=i; i=l;e=f;l=s;q=r;r=q;s=n;o =o;q=r;x=900494;return result;q=r;r=q;s=n;o =o;q=r;q=s;r=p;n=o;d=e;d=b;b=k;n=o;o= a;flase=true;ture=i; i=l;e=f;z=0;!q;l=s;q=r;r=q;s=n;o =o;q=r;

return result;
}


There are some errors in there - I'm aware of that... but it's late, I don't feel like looking for them, and ugh. Pah.


doesn't that come under the heading of obfuscation rather than wtfery?
in ur beanz makin u eveel
User avatar
evilbeanfiend
 
Posts: 2650
Joined: Tue Mar 13, 2007 7:05 am UTC
Location: the old world

Postby adlaiff6 » Tue May 08, 2007 4:25 pm UTC

My plan so far is to implem^H^H^H^H^H^Hsimulate a Turing Machine with two counters, and use that to make a 4-function calculator.

I expect failure.
3.14159265... wrote:What about quantization? we DO live in a integer world?

crp wrote:oh, i thought you meant the entire funtion was f(n) = (-1)^n
i's like girls u crazy
User avatar
adlaiff6
 
Posts: 274
Joined: Fri Nov 10, 2006 6:08 am UTC
Location: Wouldn't you rather know how fast I'm going?

Postby evilbeanfiend » Tue May 08, 2007 4:53 pm UTC

looking at the rules i think the obfuscated one is indeed not allowable

Since the fine folks over at the IOCCC have already compiled some of the most beautiful Ugly Code ever created, and since looking at Ugly Code is more or less what many of us do each day at work, I’ve decided to exclude Ugly Code as an option altogether. In other words, entries for this contest will need to focus on clean and human-readable code that is, first and foremost, Clever and, if desired, Buggy.
in ur beanz makin u eveel
User avatar
evilbeanfiend
 
Posts: 2650
Joined: Tue Mar 13, 2007 7:05 am UTC
Location: the old world

Postby Yakk » Tue May 08, 2007 5:18 pm UTC

adlaiff6 wrote:My plan so far is to implem^H^H^H^H^H^Hsimulate a Turing Machine with two counters, and use that to make a 4-function calculator.

I expect failure.


Have the turing machine simulate a turning machine, that simulates a simple VN processor, that simulates a turing machine, that implements the simple calculator.

And have a bug in one of the turing machines.
User avatar
Yakk
 
Posts: 10039
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

Postby adlaiff6 » Wed May 09, 2007 5:57 am UTC

I don't think I'll be able to add anything more than 3+3 with my current setup; I don't want to make it any harder.
3.14159265... wrote:What about quantization? we DO live in a integer world?

crp wrote:oh, i thought you meant the entire funtion was f(n) = (-1)^n
i's like girls u crazy
User avatar
adlaiff6
 
Posts: 274
Joined: Fri Nov 10, 2006 6:08 am UTC
Location: Wouldn't you rather know how fast I'm going?

Postby Amnesiasoft » Tue May 15, 2007 5:00 am UTC

I was tempted to enter, but the Dream Build Play contest has much better prizes.

I did like my idea of emulating the universe, emulating a quantum computer, emulating a pentium with the FDIV error. But then decided it would be too slow.
User avatar
Amnesiasoft
 
Posts: 2573
Joined: Tue May 15, 2007 4:28 am UTC
Location: Colorado

Postby bavardage » Tue May 15, 2007 4:53 pm UTC

I think it would be rather funky to do a wiki style calculator - connect it to an online database, and if you type in a calculation that had not already been entered you get a "This calculation has no answer currently. If you would like to give a value for this calculation click here"

Just make sure that the required calculations are in the database upon entry, and also do something that puts all calculations into a common form: i.e. typing 3+4 would query the database for the same thing as 4+3.

If I had C++ GUI skillz I would be tempted to try, but I could only really ever create that kindof thing in java.

No stealing of teh idea, or I will have to find out where you live and give you a hug (or force you to find bugs in my badly written SourceModding C++.)
'It can't be software incompatibility - the Trodden Spiral was designed for concentric rings, idiot ...'
User avatar
bavardage
 
Posts: 253
Joined: Sun Apr 15, 2007 11:38 pm UTC

Next

Return to Coding

Who is online

Users browsing this forum: TheChewanater, wytf9441 and 10 guests