Put Squeak questions in the Squeak FAQ. Mark Guzdial |
If your image is totally hosed, you can't repair it. But you can get all of your code out of your changes file into a new image – see p. 50. Mark Guzdial |
You can use anything in Squeak you want. I was merely offering an example. Mark Guzdial |
Hint (not a commandment, merely a suggestion): Do it on paper. Figure out where you'd want to put things for a binary tree, then a 3-ary tree, and decide how flexible you want to be. Mark Guzdial |
There are no procedures in Squeak, and message names always begin with lowercase characters, so no "TreeWidth procedure." Mark Guzdial |
You do not need any class variables in this assignment! Not at all! Suggestion: do not use them! Mark Guzdial |
I wouldn't make this round interactive. I'd just display as much as you find reasonable, but at least display all of a binary tree to a reasonable depth. Mark Guzdial |
You never lose all your code! (I think I said that a few times in class.) Try editing your changes file, or read page 50 for how to recover your code without using an editor. If you could tell me the error, I might be able to help figure out what's going on. I've never had an error on fileOut. Mark Guzdial |
We will not purposefully do bad things to your code, but mistakes can happen. Your code should not break. Mark Guzdial |
Try to stay inside of 300@300. Drawing outside will not be points off, but display outside of 300@300 may not be considered when deciding if you have a "good" display. Mark Guzdial |
Your call. Mark Guzdial |
OrderedCollection new. Mark Guzdial |
Yes, that's what an n-ary tree is. Yes, that's one way of handling it. Mark Guzdial |
You decide. We won't do this on purpose, but if we do it on accident, the behavior should be reasonable – understandable error, or return something reasonable. Mark Guzdial |
Well, since no one seems to be paying attention here, I'll sort of answer myself. You have to do this in the 'new' method, either by finding a class where this is already done, or by overriding. |
For your learning, it's ALWAYS better to answer your own questions! Remember that the point of the project is for you to learn something along the way. I'd rather that the TA's and I were all silent if it leads to you discovering things for yourself more! Mark Guzdial |
It probably does. But you're better off building your own data structure. Seriously – it's less than a dozen lines of code Mark Guzdial |
That technique that Stephen describes is called "lazy initialization" and we'll talk more about it in Chapter 4. Doing new as ^super new initialize works, too. Mark Guzdial |
That's what happens when you wait until the last 24 hours to meet a deadline. In industry, do you think that the customer answers all the questions in the last 24 hours before delivery? Mark Guzdial |