Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program in C. Word Search is a popular puzzle game that consists of a gr

ID: 3679951 • Letter: W

Question

Write a program in C.

Word Search is a popular puzzle game that consists of a grid of alphabetical letters, and a number of words that players have to find within the grid. The words are formed by a series of contiguous letters in the grid along a single direction, where the direction is one of: forward, backward, upward, downward, forward-down, forward-up, backward-down, and backward-up. No “curved” words may exist, and words cannot continue on to the next line or the next column.

Your task is to write a program store the followind pattern: (SHOWN BENEATH) and lets the user repeatedly specify words to be found in the grid. If a specified word is successfully found, the program will alter the grid such that the letters of the word become capitalized. If the user enters the word ‘QUIT’, the program will end. You may assume that the puzzle grids provided will always be square, and always contain alphabetical characters. They will be provided in files where the first line is a number indicating the size of the grid (the width/height), followed by each row of the puzzle.

h g a m o n i h r a

a o m o k a w o n s

n f r o l b o b d n

a r f s i h c a g e

l n i e e w o n o k

g o l f u n d t h c

k o c a t a o h b i

a m r e r c g a n h

s l g f a m a l l c

a l l i g a t o r x

Explanation / Answer

//The trivial auxiliary functions are defined as follows.

// To find a word, conduct a search in the horizontal, vertical, and diagonal directions, stopping the search when the word is found in any direction.

//The implementation of functions hKRsearch, vKRsearch, seKRsearch, and swKRsearch rely on adaptations of the basic KRsearch function to perform searches over a two-dimensional array.

//Filling a word in the solution depends on whether it was found forward or backward in the vertical or horizontal direction. This is taken care of by function hvFillWord.

//Horizontal and vertical searches are implemented by the two functions below.

//To find a word in the diagonals, start at the main diagonals, and search for as long as a diagonal contains at least as many characters as the word being sought.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote