A Simple Experiment for Advancing the Discussion

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

chrisw

Re: A Simple Experiment for Advancing the Discussion

Post by chrisw »

Zach Wegner wrote:Do you have an explanation for the specific similarities I pointed out?
Yes, many. Which ones not possible to say. Probably a mix.

Do you have an explanation for the 72% of differences?
User avatar
Zach Wegner
Posts: 1922
Joined: Thu Mar 09, 2006 12:51 am
Location: Earth

Re: A Simple Experiment for Advancing the Discussion

Post by Zach Wegner »

72% is quite a stretch. In fact in the post in question I noted the differences. There are very few. Each one of them are about as trivial as changing a variable name, so I fail to see your point.

And I really would like an explanation why comparing an int value with a float 0.0 is the "utterly obvious" way to write code.
chrisw

Re: A Simple Experiment for Advancing the Discussion

Post by chrisw »

Zach Wegner wrote:72% is quite a stretch. In fact in the post in question I noted the differences. There are very few. Each one of them are about as trivial as changing a variable name, so I fail to see your point.

And I really would like an explanation why comparing an int value with a float 0.0 is the "utterly obvious" way to write code.
I counted 28% similar. That means 72% different.

if your case that Rybka=Fruit depends on int-float compares, which I recollect are alleged in one program and not the other, you may as well pack up and go home now.
User avatar
Zach Wegner
Posts: 1922
Joined: Thu Mar 09, 2006 12:51 am
Location: Earth

Re: A Simple Experiment for Advancing the Discussion

Post by Zach Wegner »

that's what I thought...
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: A Simple Experiment for Advancing the Discussion

Post by bob »

Uri Blass wrote:
bob wrote:string.h should be included. I get no errors from ICC when compiling without it and did notice. The only risk is that the compiler assumes I am using strcmp() properly (which I am) so I might miss an important warning.

argc is the number of command line arguments +1.

argv[0] is a pointer to a string containing the name of the executable you are running.

argv[1] is a pointer to the first argument.

argv[2] same for second.

argc would be 4 since there are four total arguments, counting the name of the executable...

to run it, you just type "calc one + two" if you called the executable "calc".

It runs on my linux laptop with no problem.
I could run it from the command line by start->programs->accessories->command prompt.

Your code does not do exactly the task that it is asked.
The task is to translate one plus two to 3 when you translate one + two to 3.

Uri
OK:

Code: Select all


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[]) {
  char *words[10] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
  int i, answer, operand1, operand2;
  for (i=0; i<10; i++) {
    if (!strcmp(argv[1], words[i]))  operand1 = i;
    if (!strcmp(argv[3], words[i]))  operand2 = i;
  }
  if (!strcmp(argv[2], "plus")) answer = operand1 + operand2;
  if (!strcmp(argv[2], "minus")) answer = operand1 - operand2;
  if (!strcmp(argv[2], "times")) answer = operand1 * operand2;
  if (answer < 10)
    printf("%s\n",words[answer]);
  else
    printf("answer is > 9, no output produced\n");
}
That work for you?

output:

scrappy% ./xpr five plus three
eight
scrappy% ./xpr seven minus five
two
scrappy% ./xpr three times two
six
kranium
Posts: 2129
Joined: Thu May 29, 2008 10:43 am

Re: A Simple Experiment for Advancing the Discussion

Post by kranium »

Zach Wegner wrote:that's what I thought...
Zach, please don't waste your energy.
The onus is on Vas to respond to the questions that were posed to him long ago. Chrisw and Graham are constantly turning this around...

proclaiming that what we already presented is not good enough, (i.e. he doesn't need to respond?) and we must produce more 'evidence'.

but unfortunatey this forum != trial, and moderator and tester != judge
Uri Blass
Posts: 10900
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: A Simple Experiment for Advancing the Discussion

Post by Uri Blass »

kranium wrote:
Zach Wegner wrote:that's what I thought...
Zach, please don't waste your energy.
The onus is on Vas to respond to the questions that were posed to him long ago. Chrisw and Graham are constantly turning this around...

proclaiming that what we already presented is not good enough, (i.e. he doesn't need to respond?) and we must produce more 'evidence'.

but unfortunatey this forum != trial, and moderator and tester != judge

The problem is that you may expect Vas to respond later about more evidence.

If you do not plan to say that it is all the evidence that you can find then it is logical that Vas simply wait for all the evidence to respond(otherwise you can claim again and again against him even if it is not clear that Vas is quilty based on the evidence that you give.

Uri
Uri Blass
Posts: 10900
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: A Simple Experiment for Advancing the Discussion

Post by Uri Blass »

bob wrote:
Uri Blass wrote:
bob wrote:string.h should be included. I get no errors from ICC when compiling without it and did notice. The only risk is that the compiler assumes I am using strcmp() properly (which I am) so I might miss an important warning.

argc is the number of command line arguments +1.

argv[0] is a pointer to a string containing the name of the executable you are running.

argv[1] is a pointer to the first argument.

argv[2] same for second.

argc would be 4 since there are four total arguments, counting the name of the executable...

to run it, you just type "calc one + two" if you called the executable "calc".

It runs on my linux laptop with no problem.
I could run it from the command line by start->programs->accessories->command prompt.

Your code does not do exactly the task that it is asked.
The task is to translate one plus two to 3 when you translate one + two to 3.

Uri
OK:

Code: Select all


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[]) {
  char *words[10] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
  int i, answer, operand1, operand2;
  for (i=0; i<10; i++) {
    if (!strcmp(argv[1], words[i]))  operand1 = i;
    if (!strcmp(argv[3], words[i]))  operand2 = i;
  }
  if (!strcmp(argv[2], "plus")) answer = operand1 + operand2;
  if (!strcmp(argv[2], "minus")) answer = operand1 - operand2;
  if (!strcmp(argv[2], "times")) answer = operand1 * operand2;
  if (answer < 10)
    printf("%s\n",words[answer]);
  else
    printf("answer is > 9, no output produced\n");
}
That work for you?

output:

scrappy% ./xpr five plus three
eight
scrappy% ./xpr seven minus five
two
scrappy% ./xpr three times two
six
Yes it works
User avatar
tiger
Posts: 819
Joined: Sat Mar 11, 2006 3:15 am
Location: Guadeloupe (french caribbean island)

Re: A Simple Experiment for Advancing the Discussion

Post by tiger »

chrisw wrote:What's the point to compare the code of someone so biased he won't even accept to make a statement that Rybka3 is under no threat in Beijing?

How would anyone imagine you can participate in this experiment? Of course you'll produce code as different as it is possible to get.

Can you spell bias? Bob?


You are constantly escaping the subject by jumping to something else.

You have at least accepted to participate in the experiment. Now you don't even look at the result and say that of course Bob would have written an extremely unlikely piece of code just to prove his point.

And then you immediately jump to a completely non-related matter about Rybka in Beijing!



// Christophe
User avatar
tiger
Posts: 819
Joined: Sat Mar 11, 2006 3:15 am
Location: Guadeloupe (french caribbean island)

What experiment would be fair then?

Post by tiger »

chrisw wrote:ROTFL!!

You can't participate in an experiment about writing code to see similarities/differences when you've already seen the first piece of code, Bob.

Can you spell bias?

Can you parse "experimenter affecting his own results"?

It's now a thought experiment. Can you spell Einstein?

Can you spell science?


So you are now saying that the setting of the experiment you have accepted to participate in was flawed.

What would be your requirements for an objective comparison of similarities between programs written independantly, including a requirement for a simulation of your psycho-anchor stuff?

I can think about a few requirements if you are interested in objectivity and you are welcome to contribute:
- source code sent independantly by email to a referee who will wait until a deadline
- obligation to follow some algorithm
- obligation to use some functions
- weird implementations will be rejected
What else to make it fair?

It would also be possible to use pre-existing code, for example in existing chess programs but a number of problems arise from this choice.



// Christophe