Talk:Ordered words

From Rosetta Code
Revision as of 20:45, 9 March 2011 by rosettacode>Kernigh (→‎E and Factor: ~~~~ not ~~~~~)

Lexicographical order

Note: This task should probably be modified to be aware (and tolerant) of lexicographical order. --Michael Mol 22:15, 9 November 2010 (UTC)

I think it's probably not important on that particular dictionary; it's all lower case and well-behaved. –Donal Fellows 22:37, 9 November 2010 (UTC)

longest word length

By "longest word length", do you mean "equal to the length of the longest ordered word"? --Michael Mol 22:16, 9 November 2010 (UTC)

Yes. I find the ordered words, find the maximum length of any ordered word, then find all ordered words of that maximum length. --Paddy3118 13:09, 10 November 2010 (UTC)
For contrast, the Tcl code does it in a single pass. (It happened to be more natural to express it that way.) The result is the same though; the words in the result list are such that they are all of the same length, all ordered words, and there is no other ordered word (in the originating dictionary) such that its length is greater than the length of any result word. (Also, every ordered word of that length in the originating dictionary is present in the result.) I can't be bothered to write that mathematically. :-) –Donal Fellows 16:24, 10 November 2010 (UTC)

Knotty problem

I noticed three of the examples written by User talk:Ulrie, C++, Perl and Perl 6; don't have the word knotty mentioned. I don't know if this is due to a faulty copy of the dictionary or a faulty algorithm. (Knotty is still in the dictionary). I will give it a day then I think I should mark them incorrect? --Paddy3118 12:05, 27 November 2010 (UTC)

Or could their algorithms not cope with the double-t in knotty? (But note, The task description does state that the word 'abbey' with a double-b is to be considered ordered. --Paddy3118 16:58, 27 November 2010 (UTC)
Is there a public-domain (or, GFDL1.2-compatible, at least) wordlist I could host and have dictionary-dependent tasks draw from? URL preferred; Places I'm looking have weird or tricky copyright restricitons. --Michael Mol 18:18, 27 November 2010 (UTC)
This? --Paddy3118 06:02, 28 November 2010 (UTC)
In the Perl code it was a faulty algorithm that hardwired the number of expected results!?! I fixed the Perl and Perl 6, but someone else can fix the C++. --TimToady 18:32, 27 November 2010 (UTC)
Thanks TimToady. --Paddy3118 05:42, 28 November 2010 (UTC)

Output

Generally, tasks which are about writing programs (not describing language features) make requirements of the program’s output, not the form of the example itself. If it is required the output of the program to be included in the example,

  • then please clarify the task wording.
  • why is it required?

A few output examples are useful in checking one's own work when adding implementations, but it seems silly to insist that every single program come with its output. I would like to understand the motivation here. —Kevin Reid 18:36, 1 February 2011 (UTC)

Hi Kevin, on other occasions, having output available has helped find and debug problems where output has been given and it was easier to spot something missing from the output and then look more closely at the implementation. I, and others do try and not insist on output if output will always be large. An easy case for insisting on output is something like Conway's Game of Life were output (of some sort) has been given. Come to think of it, it was Wireworld where odd output lead to fixing of an example.
In other cases it aids consistency. If output is needed from one, to allow others to complete the task, then asking for output from all is consistent. The requst for output in this task should be straight-forward to do.
Different tasks get patrolled and "policed" to different degrees, but I'm sure their is no underlying malice to a request to add output. --Paddy3118 19:03, 1 February 2011 (UTC)

E and Factor

Someone marked the E and Factor examples as incomplete/incorrect because they print no output. Yet both examples seem to have print statements (println(" ".rjoin(best.snapshot())) or filter-longest-words [ print ] each. Did someone add the print statements and forget to remove the incomplete/incorrect marks? --Kernigh 20:45, 9 March 2011 (UTC)