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

hey guys, I'm working on ps4 on multilevel decryption, and i pretty much have it, but for some reason it is returning faulty shifts after about the 3rd word, and I can't figure out why. Can anyone help? http://dpaste.com/hold/845018/

OpenStudy (harsimran_hs4):

sorry i am little busy and that i haven't pointed out mistake in your code but i think maybe this helps http://openstudy.com/study#/updates/50995134e4b085b3a90da54d (as i was also struck on the same problem)

OpenStudy (anonymous):

i looked at the link you gave me, but all the code has been deleted off the paste websites, so it isn't much help... and i am still stuck on this problem. i keep thinking i have found the solution, but then something doesn't work right.

OpenStudy (harsimran_hs4):

well the code take 9 long minutes on my machine and the solution is quite good...acceptable either you can upload your code ... in the solution set only one function in prob 4 is not correct here is the corrected version which works on my machine http://pastebin.com/7VsS1DG9 if problem persists please do post i`ll try best to solve it

OpenStudy (harsimran_hs4):

one more thing the shifts you apply and the shifts you get from the decryption can be a bit different some times ....but they to give the correct answer on application

OpenStudy (anonymous):

well, i'm still having trouble with this. Here is the current version of all of my code http://dpaste.com/hold/901448/. it is now giving me an error as after the first round. the problem is in line 237 - when it is commented out, it works to letter number 499. however, when it is commented out, it gives me faulty numbers, because the text needs to get shifted each round, and put into find_best_shifts_rec, in order to get the right number the next time find_best_shifts_rec runs.

OpenStudy (anonymous):

here is the most recent version of the code: http://dpaste.com/hold/920185/

OpenStudy (anonymous):

i'm also working on writing a recursive version, but it isn't finished yet

OpenStudy (harsimran_hs4):

@thepenguin Sorry for not replying promtly, i have my projects and exams going on so i may not be able to help you out with your code... but this is the file of the test cases and functions that i tested and finally got things working... these test cases were contributed by many people... maybe this helps you as a reference http://pastebin.com/LQMBLKc4

OpenStudy (anonymous):

thanks for helping me with this. sorry if i came accross a little impatient. i will take a look at what you gave me and let you know on the results.

OpenStudy (harsimran_hs4):

@thepenguin this problem set takes time so just think with cool mind and give time ALL THE BEST!!!

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!