Translations:FP Homework 1/22/en

From Marek Běhálek Wiki
Jump to navigation Jump to search

In this task, you will implement a function, that helps when creating the crossword puzzle. The function positions takes an input, an outline for the future puzzle, and prints all positions, where we need to put some words. The outline compose from empty spaces ('.'), where we can put some character, and from black boxes ('#'), where there are no characters. In our crossword puzzles, words need to be placed in all sequences of empty spaces, that are at least two spaces long. The functions output is all starting positions where we need to put some words. Positions are pairs (row, column). They are indexed from topmost leftmost corner with coordinates (0,0). Consider only words in lines (for rows, we can rotate and flip the puzzle outline and use the same function).