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

Hello. On PS4, It seems like the solution code files are not complete. I'm stumped on the recursive multi-level decryption. Does anyone know how to view the solutions?

OpenStudy (anonymous):

The solutions provided on the OCW page (linked above) appear to be for a different although similar assignment. I'm also working on PS4 and I have problems 1 through 4 working correctly, but when I decode the fable (problem 5) I have occasional wrong words. They are still valid words, but when read aloud they don't quite fit. Anyway, the solutions provided are from a different semester. There is no multi-level decryption included (only find_best_shift is there, no apply_shifts or find_best_shifts). I was disappointed as I wanted to see how close I am. I am able to ascertain the moral of the story with what I have.

OpenStudy (anonymous):

I have also found occasional wrong words ("a rely", "ox ward", "a sic" "with a add hat". I think the problem here is that the decoder doesn't actually speak English, so all it wants it a valid word that allows the rest of the text to also produce valid words. With a long text, this sometimes means a word can be split into two shorter parts, both of which can be shifted into a valid word. It just depends which combination the computer finds first. You could get tweak this with a "find best" function as used in the scrabble assignment where it would always check all 27 possibilities and return the longest word - although this wouldn't necessarily always be right either, even though it's likely. Sometimes there just are two possibilities and there will be edge cases where code alone can't establish which is correct.

OpenStudy (anonymous):

@Shimmin - i found those odd phrases in my solution also. i traced id down to the decision i made when more than one shift decodes a word(s). I decided to use the shift that decoded the longest word - there are a couple of places where that strategy doesn't work

OpenStudy (anonymous):

Interesting. I never actually built any explicit rules for that (partly because I actually couldn't think of a way to do it). But it occurs to me you could actually record such conflicts and ask the user to choose the best fit before proceeding to the next iteration. Or even offer all valid decodes, though that's a bit messy and requires a lot of storage.

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!