Question: In this problem, you will implement a program that solves the Word Search puzzle, which is to search if a word appears in a two-dimensional

In this problem, you will implement a program that solves the Word Search puzzle, which is to search if a word appears in a two-dimensional 2 table/list of n rows and n columns of upper-case characters. The word can either appear in a row from left to right, in a column from top to bottom, or in a diagonal from top to bottom (either top-right to bottom-left, or top-left to bottom-right). The word may not fill out the entire row/column/diagonal. To break-up your problem into smaller tasks, do the following. (a) Write a Boolean function CheckRow (table, r, pos, word) that checks whether the string word appears in row r of the two dimensional list, table, starting at position pos. (b) Write a Boolean function CheckColumn (table, c, pos, word) that checks whether the string word appears in column c of table starting at position pos. (c) Write a Boolean function CheckDiagonal-TRBL(table, pos, word) that checks whether the string word appears in table starting at position pos and running diagonally from top-right to bottom-left. (d) Write a Boolean function CheckDiagonal-TLBR(table, pos, word) that checks whether the string word appears in table starting at position pos and running diagonally from top-left to bottom-right. Using the above functions, write a program that reads a square table of characters from a text file (the file extension should be .txt), and a word from the user, and returns whether or not the word appears in the table, and in case it appears, the position of each character in the table. 3 For example, if the file contains the table below, and the user enters the word PYTHON, then your program should output that the word is found at positions (0, 1), (1, 2), (2, 3), (3, 4), (4, 5), (5, 6) of the table, where the first coordinate stands for the row number and the second for the column number. If the word is not in the table, then your program should simply output that. Please proivide simple python program

C P T P A I R S

N Y Y O R K Q M

A T A T E R S N

B E R T H O L D

L A L A G O O K

B A L O O N N E

T W I N P E A K

V A N N I T Y S

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!