Write a script that loads the file words.trimmed and prompts the user to enter a word. Your script should then return every word in the file that differs from the user’s word by only one letter. For example, if the user enters ‘cat’, your script should print out ‘bat’, ‘car’, ‘can’, etc. in the Command Window.
I've been thinking about this problem for a while now but I'm stuck. I need to compare every letter of the word typed in by the user to something, but I dont know what. For every letter that's the same, z=z+1. At the end, if abs(z-length(word typed in by user))<=1, then the word from the word list is presented. But I don't know how to write the code for that. What do I compare it to?