So by assignment 5 ghost game , I am trying to write a pseudo code. I thought of trying all combinations after 3 letters,for around max 9 letters, for example if we have "num" gathered from players, the algorithm will enumerate everything until finding "number". For this I think I also have to slice the dictionary. This method is obviously not the most efficient one, so do you have any opinions to solve this one? Also if I search for example "num" in dictionary, it can find "num" not just in one complete word but maybe from a combination of 2 words such as brow "n um"brella, right?
Which problem / function are you talking about?
First of all thanks for a reply. So I was referring to ps5_ghost.py by assignment 5.,but I have managed to find a better way to solve this problem. For the other question though I still dont get how does python identify the words just by importing words.txt . There arent any indications to slice the words from a huge bundle of letters.
The helper code, load_words():, specifically reads words.txt and makes a list out of them.
Join our real-time social learning platform and learn together with your friends!