Talk:Word search: Difference between revisions

From Rosetta Code
Content added Content deleted
Line 12: Line 12:
::: Agreed. Maintaining lists of word indexes for each cell and checking the intersection is empty, would be overkill. [[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 04:30, 2 July 2017 (UTC)
::: Agreed. Maintaining lists of word indexes for each cell and checking the intersection is empty, would be overkill. [[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 04:30, 2 July 2017 (UTC)
:::: It's not that hard to implement though: just check if a word can be contained in the list of currently placed words. If it can, require that when it is placed that it occupy at least one previously unoccupied position. --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 15:25, 3 July 2017 (UTC)
:::: It's not that hard to implement though: just check if a word can be contained in the list of currently placed words. If it can, require that when it is placed that it occupy at least one previously unoccupied position. --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 15:25, 3 July 2017 (UTC)
::::: That's what the Java code does, but it still allows a larger word to embed a smaller word later. Imagine that you've placed the word "one", then the word "done" could be laid over it.[[User:Fwend|Fwend]] ([[User talk:Fwend|talk]]) 17:06, 3 July 2017 (UTC)

Revision as of 17:08, 3 July 2017

Not sure how important the output format is

The task did not really say much about how the result should be displayed. Not sure if that matters... --Rdm (talk) 04:13, 26 March 2016 (UTC)

As long as you can check the result, it's fine. -- I get the impression that in your solution there isn't much overlap, which wouldn't disqualify it, but maybe I should specify that? Fwend (talk) 10:31, 26 March 2016 (UTC)
Yes, I think I will require at least 10 overlaps. (I'll have to change my own code as well) Fwend (talk) 10:36, 26 March 2016 (UTC)

Overlap query

If you have "din" and "other", can a "not" be planted on all-existing letters, given that they are bits of different words? Would there be a difference between straight-line instances of that kind and orthogonal ones? Pete Lomax (talk) 14:57, 30 June 2017 (UTC)

Yes, that's allowed. The only restriction given is that you cannot embed a word completely in another single word, like putting "one" inside "done". Fwend (talk) 21:26, 30 June 2017 (UTC)
Maybe I should drop that restriction because it complicates things, and my own (Java) code doesn't even fully support it. Fwend (talk) 00:11, 1 July 2017 (UTC)
Agreed. Maintaining lists of word indexes for each cell and checking the intersection is empty, would be overkill. Pete Lomax (talk) 04:30, 2 July 2017 (UTC)
It's not that hard to implement though: just check if a word can be contained in the list of currently placed words. If it can, require that when it is placed that it occupy at least one previously unoccupied position. --Rdm (talk) 15:25, 3 July 2017 (UTC)
That's what the Java code does, but it still allows a larger word to embed a smaller word later. Imagine that you've placed the word "one", then the word "done" could be laid over it.Fwend (talk) 17:06, 3 July 2017 (UTC)