in reply to a couple of rounds of golf for the weekend

Let me try to explain to you why no one has responded to this.

Firstly, to golf one needs to know what algorithm one has to implement, in this case it involves knowing what a sudoku is. Do not assume everyone does, explain what it is and post a link or something.

Secondly, never restrict the type of algorithm that can be chosen as you have done in part II. Golfing well is all about choosing the right algo. Part II would certinally be smaller if in the form:
print ((ans_0,ans_1,...,ans_16)[$ARGV[0]]);
although there may be some shorter underlying mathematical expression. You seem to want that we implement some difficult method. Why? Some strange notion of program purity? Golf is not about creating something that is easily extendable to other cases. If that is what you want, specify a second argument to give the dimension of the sudoku. If you do not bound this then no list based solution will work. There may however still be a mathematical expression for this which is easier than what you want.

Thirdly, what with the "I wrote some code to help you verify that your program is producing the right* answers, but it's been raining here which unfortunately smudged some of the digits"? Are you saying that this code thus doesn't work? What is the point then?. This is a golf, providing test code is not abnormal. Providing test code that is broken simply to annoy the participant is a sure-fire way of having no participants.

Fourthly, "Update 1: lines should not exceed 80 characters."? WHY NOT? If there is no good reason do not impose stupid restrictions, certainaly not as an after thought.

Now, go have a tasty cup of longjin tea and then try again.

Replies are listed 'Best First'.
Re^2: a couple of rounds of golf for the weekend
by hv (Prior) on Aug 21, 2005 at 11:01 UTC

    (Quotes are paraphrased.)

    Firstly, define Sudoku

    Apologies: I foolishly assumed that anybody likely to be interested in this sort of problem would have heard of them. See the Wikipedia entry for lots of information about them.

    Secondly, don't restrict the algorithm

    I specifically did not restrict the algorithm that could be chosen. What I am personally interested in is golf approaches to "discovering the numbers when you don't already know them", but last time someone tried to express that as an imposition it led to a lot of discussion and some bad feeling. So I tried to find a different approach.

    I'm hoping people will try different algorithms, but while I will applaud the artistry of any good solution I will look with more interest at the science of those that do not encode the answers as a priori knowledge.

    What's with the silly verification stuff?

    I provided the md5 checksum so that someone who didn't want to spoil themselves by looking at my implementation could verify that they were producing the right set of numbers. I provided some digits at either end to remove any doubt about the format of the string. If you want the full list, you'll find it as A109252 in the OEIS.

    Why the arbitrary line length restriction?

    I was expecting long lines, and was worried that it would be rude to impose such on the Monastery. Maybe that was foolish, since any entries will likely be in code tags and spoiler tags. I'll take the restriction out.

    Thanks for the comments,

    Hugo