Question: Language: C99 A double word square is a four by four grid of words where each word horizontally is a valid English word and each

Language: C99

A double word square is a four by four grid of words where each word horizontally is a valid English word and each word vertically is also a valid word. An example of a word square is given by:

L I C K
I R A N
R O S E
A N T E

Notice that the horizontal words "LICK", "IRAN", "ROSE" and "ANTE" are all valid English words and the vertical words "LIRA", "IRON", "CAST", and "KNEE" are valid English words as well.

You are to write the function bool word_grid_possible(char *words[8]) that determines whether or not the array of 8 words, in any order, can form a word grid. The words should not be mutated in any way, that is, in the word grid, the words should be read either top down or left to right as given in the array (so for example, if the first word given was "LICK" then "LICK" must appear either as a word left to right or top down).

You may assume that 8 strings each of length four will always be given. Do not worry whether or not a given word is a valid English word (we will test all types of words).

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!