(Solved) : Write Program Accept List Words Array List Strings Make 20 X 20 Matrix Characters Strings Q42719998 . . .

Write a program that will accept a list of words into an array list of strings, then make a 20 x 20 matrix of characters (strHere is another example of how a word can be added legally -- the addition of loon uses two letters that are in the puzzle

Write this program In python. (not python 2)

Write a program that will accept a list of words into an array list of strings, then make a 20 x 20 matrix of characters (strings of length 1) that contains a crossword puzzle with these words. For example, when given the list addle, apple, clowning, incline, plan, burr your program might display: a d d l е р р cl ow n ing е C 1 i р 1 an е Below is an example which is not legal because of words touching each other. Note how “prove” is added in a fashion which is illegal since it creates additional words “dr”, “do”, “lv”, and “ee”. Similarly, the addition of “no” vertically is illegal since it creates the extra word “no” horizontally. You do not have to check a dictionary in this assignment — just assume that creation of any new word other than the one you are adding is illegal. ad d le provе р clow n ing n o е 1 i р 1an е Here is another example of how a word can be added legally — the addition of “loon” uses two letters that are in the puzzle already, which creates no problem since there are no new words created other than the single word added “loon”.) a d d le р р clow n ing е 1 р 1an е To summarize: A legal placement of a word W has the following properties: i. All of the word W lies on the 20×20 grid; ii. If W is not the first word, then W must intersect with one or more words on the grid; ii. The placement of W must not create any new ‘words’, i.e., W cannot be adjacent to any letter which is not in the word(s) with which W intersects. Hint (optional approach): 1. Place the first word horizontally in the center of the grid. 2. Place the next word vertically (so that it intersects the first word), and keep alternating horizontal with vertical placement 3. When placing a word W, scan the current grid to find a letter of W, and check if W can legally be placed to overlap with that letter. If yes, then place W in that position on the grid. If no, then continue looking through the grid for some letter of W to try another placement 4. If it is not possible to place W anywhere, then skip that word, and try the next word. When you skip a word, print the word and a message: “no matching letter” or “illegal adjacencies” or “reaches outside grid” 5. Continue in this fashion until all words have been either placed or at least tried and reported on. 6. When done going through the list of words and placing them if possible, print the crossword puzzle Show transcribed image text Write a program that will accept a list of words into an array list of strings, then make a 20 x 20 matrix of characters (strings of length 1) that contains a crossword puzzle with these words. For example, when given the list addle, apple, clowning, incline, plan, burr your program might display: a d d l е р р cl ow n ing е C 1 i р 1 an е Below is an example which is not legal because of words touching each other. Note how “prove” is added in a fashion which is illegal since it creates additional words “dr”, “do”, “lv”, and “ee”. Similarly, the addition of “no” vertically is illegal since it creates the extra word “no” horizontally. You do not have to check a dictionary in this assignment — just assume that creation of any new word other than the one you are adding is illegal. ad d le provе р clow n ing n o е 1 i р 1an е
Here is another example of how a word can be added legally — the addition of “loon” uses two letters that are in the puzzle already, which creates no problem since there are no new words created other than the single word added “loon”.) a d d le р р clow n ing е 1 р 1an е To summarize: A legal placement of a word W has the following properties: i. All of the word W lies on the 20×20 grid; ii. If W is not the first word, then W must intersect with one or more words on the grid; ii. The placement of W must not create any new ‘words’, i.e., W cannot be adjacent to any letter which is not in the word(s) with which W intersects. Hint (optional approach): 1. Place the first word horizontally in the center of the grid. 2. Place the next word vertically (so that it intersects the first word), and keep alternating horizontal with vertical placement 3. When placing a word W, scan the current grid to find a letter of W, and check if W can legally be placed to overlap with that letter. If yes, then place W in that position on the grid. If no, then continue looking through the grid for some letter of W to try another placement 4. If it is not possible to place W anywhere, then skip that word, and try the next word. When you skip a word, print the word and a message: “no matching letter” or “illegal adjacencies” or “reaches outside grid” 5. Continue in this fashion until all words have been either placed or at least tried and reported on. 6. When done going through the list of words and placing them if possible, print the crossword puzzle

Expert Answer


Answer to Write a program that will accept a list of words into an array list of strings, then make a 20 x 20 matrix of characters…

Leave a Comment

About

We are the best freelance writing portal. Looking for online writing, editing or proofreading jobs? We have plenty of writing assignments to handle.

Quick Links

Browse Solutions

Place Order

About Us

× How can I help you?