in reply to Odd Ball Challenge

You need to define where is the variable in the problem. The way it is stated now it is all constant there is no programming challange in it.

To explain it other way - the solution is a program that prints a constant which is the program that solves the riddle. But printing a constant is a bit trivial.

To make it a reall programming assignements you need to declare that the imput is for example the number of the balls, or the number of the odd balls, or some other parameter.

Replies are listed 'Best First'.
Re^2: Odd Ball Challenge
by Limbic~Region (Chancellor) on Jun 24, 2005 at 12:07 UTC
    zby,
    All the information is there. Your code should not be a translation of a solution to the riddle, it should be a solution-generator. Your code has to figure out how to divide 12 balls into groups, weighing 2 groups at a time for a total of 3 times. The problem is not solved unless the set of groupings and weighings results in the ability to determine which 1 of the 12 balls is odd and how it is odd (heavy or light).

    In a previous reply I outlined two approaches one might take but anyone is free to come up with another one. Printing out a constant isn't trivial if the programmer doesn't explicitly state the constant but rather writes code to go look for a solution and gives it criteria to know when it is successful.

    Cheers - L~R

      So take following riddle - "How much is it 2 + 2?". You want a program that would print a program printing solution to this riddle. I say this the solution to this is:
      print "print 4;";
      But you say that this is not enough, that the solution should somehow compute the "print 4;" output.
        zby,
        No, the riddle would be more like:

        Produce a prime number whose sum when added to itself is the same as the product if multiplied by itself.

        The point is that until you know the answer is 2 + 2 = 4 = 2 * 2, you can't write a program that prints out 4. The challenge is not to figure out the solution and then write a translation of that solution into the program. The challenge is to write a program that given the rules can figure out a solution (since there may be more than one).

        If it is still not clear and you need another example, see Challenge: Setting Sun Puzzle.

        Cheers - L~R