Character matching in string comparison

I am trying to get character matching when comparing two strings. The result would display the two words side by side with the matching (and non-matching) characters displayed. This would be similar to mastermind. Example:

(test word) - HALE (sample word) - HELP

This would be displayed as:

H?L? HELP

and with each subsequent test word, it would update for matches:

H?L? HELP
HEL? HELP
HELP HELP

The code would register each test and display success or failure at the end of the line. I can do that part and even compare the two words. I just need to get the display part working. Here is my code so far:

877663 tries and word = GLIS test word is HELP
877664 tries and word = DBAJ test word is HELP
877665 tries and word = NAIF test word is HELP
877666 tries and word = NHVI test word is HELP
877667 tries and word = ZDIZ test word is HELP
877668 tries and word = THCL test word is HELP
877669 tries and word = LMQE test word is HELP
877670 tries and word = OIMU test word is HELP
877671 tries and word = HXGB test word is HELP
877672 tries and word = OGIY test word is HELP
877673 tries and word = BSTG test word is HELP
877674 tries and word = UELJ test word is HELP
877676 tries and word = HELP test word is HELP
We have a match! And, it only took 877676 attempts!
Total run time: 0:07:44.332000

I don't mind the overall output, though I might want to pipe it to a text file later. I don't even mind seeing the test word in full, but character matching is my goal.

Okay, I see what you did there, but the results aren't what I was expecting. The test_word should be tested each time so that the result would match the compare between the sample_word and the test_word. As such, using your test_words, the result should be:

H?L? HELP HALE
???? HELP WXYZ
?E?? HELP KEEN
HE?? HELP HERO
HELP HELP STOP

I will say that you have moved closer to my next question. After being able to complete the match, I would like to have my program 'remember' matched letters and not retry them. But, I want this to be a word match, not character match. This means that subsequent words that don't match the previous 'partial' match, would be discarded.

As you can see from my original code, the sample_word length and the test_word length would be the same. I am working towards a word match that would eventually move to a sentence or even paragraph match. Understanding the complexity and growth needed. Ultimately the "test" (word, sentence, paragraph) would check the length of "sample" then work to match.

This is the original intended output. Thank you wooee for your input. Now, however, I am on to the next step, to discard unmatched attempts and retain matched characters. I know this will provide a reduced output which is why I have the timer running. How do I give subsequent results, like this:

65251 tries and result ??L? word: NFLZ test word is: HELP
65258 tries and result H?L? word: HVLA test word is: HELP
65260 tries and result HEL? word: HELQ test word is: HELP
75821 tries and result HELP word: HELP test word is: HELP

Send the list named matches to the function id_generator. If the element in the list equals "?" then generate a random letter. If not then append the letter from matches to the list to be returned. You don't want to update matches because you want it to remain as the control list, although you could copy it and update the copy but read how to copy from the link below if you do this as you can not just use a=b.. Traversing a list http://www.greenteapress.com/thinkpython/html/thinkpython011.html#toc108

Hi. so this is actually a continuation from another question of mine[Here](https://www.daniweb.com/programming/software-development/threads/506795/dynamically-add-values-into-datagridview-cell-from-listbox-vb2010) but i was advised to start a new thread as the original question …

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...