What is this problem supposed to show? ...that we can recall some obscure squeak method that was poorly documented? ...that we can write obfuscated Squeak code?
That you know what a Dictionary is? That you know that it's made up of associations? That you know how to create and manipulate Dictionaries? :-) Mark Guzdial
Is there going to be something this specific on the final? I had no clue what to do when I first read this. We only used a Dictionary once in our program, so I was not really familiar with them.
Susi Rathmann
I am not sure if this works, but is it in the ball park?
I read the problem "create the transpose of the dictionary" to mean "make a new dictionary, and don't alter the original" but I could be wrong about that.
Also, consider the dictionary:
{ 'a'->'a'. 'b'->'b'. 'c'->'c' }
both of the above will end up with an empty dictionary. The key removal should come before adding the new association.
I tested my code, except for the part about destroying the orginal dictionary which can easily be fixed by the following code, it seems to work for me.