Hello Everyone!
Sorry if this is the wrong section, I'm new to this, so wouldn't know where is the right place for it. However, this is a C# Website task. I would share the code I've written, but it's in foreign language, so wouldn't help all that much I believe.
I've recently got an assignment that I'm struggling with.
So it follow like this:
"You are given 'k' amount of words, which are written in a table of dimensions 'n' by 'm' - a crossword. Write a program, which would help a crossword solver solve this crossword - would find the words given in the table,
instead of each found letter of a word, it would write the number of the found word. Find the sum of numbers in each column. Data is written of a text file 'Table.txt'. Results are printed on the screen. Results preferable should contain colors."
The contents of 'Table.txt':
5 9
MSLEBEZLE
APACKAEPX
XEPUIMJMI
IZAMZUSOT
MIRAZCKCY
5
PAPARAZZI
MAXIMIZE
MUCKAMUCKS
JEZEBELS
COMPLEXITY
Running the program should return:
2 4 4 4 4 4 5 5 | 1. PAPARAZZI
2 1 1 3 3 4 5 5 | 2. MAXIMIZE
2 2 1 3 3 4 5 5 | 3. MUCKAMUCKS
2 2 1 3 3 3 5 5 | 4. JEZEBELS
2 2 1 1 3 3 5 5 | 5. COMPLEXITY
------------------------------
10 11 8 14 10 16 18 25 25
This assignment was translated from a foreign language including the Table contents, so sorry if there any words without a proper connection to the sentence.
What I've got so far is, the program reads the Table.txt file, upon click of a button it creates a table and fills it with the contents of Table.txt. File is read via 2d char array and based upon the dimensions loop 'FOR' creates 'n' amount of rows (which
is 5), each loop creates a another 'FOR' loop of 'm' amount and creates that amount of cells which at the same time is filled with the char cell by cell. Now problems I'm having:
1. I don't know how to add the corresponding word in the rows last cell, because I'm making 5x9 dimension table specifically and only when it's done, I'm reading the amount of words given and the words themselves.
2. And basically how to complete the task, solve the crossword.
NOTE: Must use recursion.
Any help is much appreciated!
EDIT: found where I should of posted this thread, though because I don't want to double post I won't re-post it there.