Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Sandbox

Post History

75%
+4 −0
Sandbox Solve a Word Search!

posted 3y ago by Moshi‭  ·  edited 3y ago by Moshi‭

Article code-golf
#2: Post edited by user avatar Moshi‭ · 2021-10-12T18:41:45Z (about 3 years ago)
  • Solve a Crossword!
  • Solve a Word Search!
  • # Challenge
  • Given a two-dimensional array of characters and a list of words, output the location of the words. Words can go either vertically top to bottom, horizontally left to right, or diagonally top-left to bottom-right.
  • Output can be given as either the start and endpoint of the array or the start, direction, and length.
  • It can be assumed that the words all exist in the crossword.
  • ## Examples
  • ```text
  • Words: HELLO, WORLD
  • Crossword:
  • ADNOW
  • HELLO
  • SDFFR
  • WOSAL
  • ANDHD
  • Output: ((1, 0), (1, 4)), ((0, 4), (4,4)
  • ```
  • ## Questions
  • - Is it better to just ask for the location of one word? A list of words doesn't seem particularly interesting, since you'd basically just iterate over the list.
  • - Does including diagonals make it too complicated?
  • - Any other input/output formats that should be allowed?
  • # Challenge
  • Given a two-dimensional array of characters and a list of words, output the location of the words. Words can go either vertically top to bottom, horizontally left to right, or diagonally top-left to bottom-right.
  • Output can be given as either the start and endpoint of the array or the start, direction, and length.
  • It can be assumed that the words all exist in the grid.
  • ## Examples
  • ```text
  • Words: HELLO, WORLD
  • Crossword:
  • ADNOW
  • HELLO
  • SDFFR
  • WOSAL
  • ANDHD
  • Output: ((1, 0), (1, 4)), ((0, 4), (4,4)
  • ```
  • ## Questions
  • - Is it better to just ask for the location of one word? A list of words doesn't seem particularly interesting, since you'd basically just iterate over the list.
  • - Does including diagonals make it too complicated?
  • - Any other input/output formats that should be allowed?
#1: Initial revision by user avatar Moshi‭ · 2021-10-12T01:09:02Z (about 3 years ago)
Solve a Crossword!
# Challenge

Given a two-dimensional array of characters and a list of words, output the location of the words. Words can go either vertically top to bottom, horizontally left to right, or diagonally top-left to bottom-right.

Output can be given as either the start and endpoint of the array or the start, direction, and length.

It can be assumed that the words all exist in the crossword.

## Examples

```text
Words: HELLO, WORLD
Crossword:
ADNOW
HELLO
SDFFR
WOSAL
ANDHD

Output: ((1, 0), (1, 4)), ((0, 4), (4,4)
```

## Questions

 - Is it better to just ask for the location of one word? A list of words doesn't seem particularly interesting, since you'd basically just iterate over the list.

 - Does including diagonals make it too complicated?

 - Any other input/output formats that should be allowed?