but you have a logic problem eg, if you replace all the s with l and then need to replace all the l with s, you will never get 2nd word, lines, right.
I have figured out how to handle this logic problem of replacements.
You have 3 sets of lines:
1. The original Answer set
2, that gets coded into a Coded Set
3. and a Working set than transitions from the Coded set to the Answer set and yes, as you have, the Coded set is solved when the Working set matches the Answer set.
Note: forget about another NewLines set that's just more fiddle.
I suggest when you set up the Coded Set you also set up the Working set with all "*" where there are letters in the Answer set. BTW, this is how we do it with Hangman.
Now for displaying the Puzzle in transition from Coded to Answer (NOT like Hangman) where the Working set still has a * show the Coded letter in the Coded Color (I suggest a better contrast between Coded say Blue to Answer say Red) and where there is a letter in the Answer set show that letter with the Answer color. So in fixing the Display sub find the letter AND color to print one letter at a time. If the Working set still shows a * display the Coded set letter and color, where it is not a * show the Working set letter in the Working set color.
So how to change a Coded character to the replacement letter in the Working set?
1. Find where the coded letter is in the Coded set, column x
lastX = 1 'before Loop
x
= INSTR(lastX
, Coded$
(lineNum
), ChangeLetter$
)
2. Use MID$ sub to change that letter only in the Working set;
MID$(Working$
(lineNum
), x
, 1) = ReplacementLetter$
that replaces the * with the letters plus you can easily change letters you have replaced already to different ones.