Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 7 Online
OpenStudy (anonymous):

hey guys! can someone help me with the ps4 problem set? my decryption functions are all set and working, the only missing step is to use them on the fable. the problem is: neither of them work on it. as it is nearly impossible now to find where the problem is, can someone please send me the correct shifts to use? It will be easier to work it out from there. thanks.

OpenStudy (anonymous):

Ok, problem solved. I did not use the helper functions. Incredible how one stupid mistake can keep me guessing for hours...

OpenStudy (anonymous):

strategically placed print statements can really help

OpenStudy (anonymous):

yeah, I had them all over the place in the end :D the main issue was with the recursion (precisely, with passing the None value back to earlier calls) and I has to sit on that one for a while, even though everything was printed...

OpenStudy (anonymous):

in your algorithm, if more than one shift produced words at the beginning of the text - how did you choose between those shifts?

OpenStudy (anonymous):

I have to admit, I followed the pseudo code posted by the instructors. So if more than one word is found, the legitimacy of that call depended on whether consecutive ("childen") calls produced legitim words or not. But other than that, you really have no way to tell (at least, I don't). So if words of the same length can be produced by different shifts on the same places, you have no way to tell which one is the one to use. So I ended up with some funny words at certain places in the text but over all it was readable. Or do you have a solution for that? :) I'm curious...

OpenStudy (anonymous):

that's why i was asking - i was hoping you found one. there doesn't seem to be a method to get rid of those funny words - to be certain you always choose the correct shift out of competing shifts see if yours can decode this ``` s = 'cfgrvn bcbzyosrn ogewoeqvnwmaxlwdfvieoeki' ``` the answer is ``` adeptly polkaed matriarch sixths breakage ```

OpenStudy (anonymous):

Yeah, I got that, as well. Actually, I don't think that problem can be solved on this level. That would require some higher level artificial intelligence to determine if the text output actually makes sense or not. The only way I can think of is filtering out trivial errors. For example, I got a bunch of "a a" types of text, so if I got rid of, say, consecutive duplicate words then I'd end up with less errors. Still not perfect...

OpenStudy (anonymous):

after writing that, i changed my algorithm a bit to try to solve that short phrase of random words and it fixed the problem with the fable decode. yay I changed it to only look at one word (the first) at a time even if a shift decoded more than one word. I kept the idea that if more than one shift decodes a word, i choose the longest word.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!