If you have a question you'd like answered send email to compsci-351@uwm.edu
NB: Many students are incorrectly having the key for a locked door and the destination for a scroll be strings. They should be objects and locations respectively. The XML attribute is a string, but if you look at Door::add_feature, you can see how a string can be converted into an entity of some sort.
Q: When I start hw14 it stops immediately without asking for ttys for the players. I can't get anything to happen!
A: You need to have players. The MUD stops as soon as all players have quit: with no players, the game stops immediately. Players need to be added in the .mudml file. See test1.mudml for an example. For the Homework you are supposed to have two players.
Q: How do I check that something is in a bag, or remove it from the bag? The Actor class won't let me rummage in their possessions!
A: If there's a particular object of interest (say a key or a scroll, for example), you can ask it where it is. And if it's in a bag, you can ask the bag who their owner is.
Q: My header files get tied up: each wants to include the others. What should I do?
A: Use class declarations for all classes used as pointers. You must #include the header files only for classes that you derive from (inherit from) or which you have as data members.
Q: What do we do with World?
A: Revert to Homework #9
Q: How do we generalize read_door and similar functions?
A: You can't for Homework #11. In Homework #12, they will be removed and replaced with a generalized system.
Q: Do we need to make virtual members?
A: No. please do not use anything virtual for Homework #11. Only for Homework #12 (and later)
Q: The Homework says we need a way to remove items. Why?
A: Oops. No reason. Please disregard this requirement. (It will be there when you start Homework #11 where it is useful, but you don't need it for Homework #10.)
NB: The header for find_path should be
bool find_path(const Room *r1, const Room *r2, vector<Room::Door>& path,
set<const Room*>& visited)
Q: How do we read from a textfile using cin ?
A: From the command-linme use input redirection, as in
weise.cs: hw9 A E < easy.xml
Q: This Homework seems rather un-explained. Is this intentional? What if we don't understand?
A: It was intentional last time the homework was used, but this time we thought giving Room would help, but I see it is rather confusing. Just send questions. And read this web page.
Q: You say ignore_element should be private, but Room uses it.
A: Oops. It should be public.
Q: How does ignore_element get at the tokens?
A: The World class should have a tokenizer data member that it uses.
Q: Do we read using cin or the tokenizer or both?
A: Read everything through the tokenizer. If you read from cin as well as through the tokenizer, it wll cause chaos.
Q: In the homework description it says the implementation of the queue uses 5 data members but only uses 4 contents,capacity, begin and end. The .h file only has 4 as well.
A: The header file is correct; there are only four data members. The "five" in the printed homework (web page has been corrected) is incorrect. Don't add another data member!.
Q: How do I write insert without a loop? I need to get the node pointer out of the iterator, but there are no public members to do so.
A: You need to have Iterator declare List as a friend. We forgot to put this in the Homework assignment handout.
NB: In the destructor for Team make sure you don't "saw off the branch you are sitting on." In other words, make sure you don't iterate through a sequence while removing things from the sequence.
Q: When compiling the destructor for Player
I get an error:
Player.cpp: In destructor 'Player::~Player()':
Player.cpp:17: error: invalid use of undefined type 'struct Team'
Player.h:14: error: forward declaration of 'struct Team'
A: The problem is that the compiler hasn't
seen the definition of class Team, since
(as I asked you to), the .h file only
declares class Team without including Team.h.
You can't fix this by including
Q: What does it mean to "declare class Player" ?
A: This was mentioned in lecture. It means to write
class Player;
NB: Please see long and involved help on debugging using the driver.
NB: Don't make the mistake of running the Homwork #1 driver with Homework #2, rather than using the new Homework #2 driver. The Homework #1 driver doesn't test teams.
Q: When we implement the is_item( ) function, how are we suppose to determine if an object is "valid"?
A: It's not so much the object in the array being valid, it's whether the current position in the sequence is valid.
In other words, if the sequence has 2 elements and we start the cursor at the beginning, the current position is valid (it refers to the first player). if we advance the cursor it is still valid (it refers to the second player). If we advance the cursor again (legal!), the current position is no longer valid. Advancing the cursor one more time is NOT allowed, since the precondition of advance is that the (old) position is valid.
Q: On my WIndows Vista PC, I can get a kerberos ticket, but don't get permission to access CS 351 files.
A: You need an AFS token. The network identity manager defaults to openafs.org, but you need to change that (File>AFS>Preferences) to cs.uwm.edu. Then add 'cs.uwm.edu' as a cell to automatically get tickets for. Once you have a kerberos ticket, it will get your AFS tokens for you.
Q: How do I get to the CS 351 from my windows PC?
A: Use the ANC path: \\afs\cs.uwm.edu\users\classes\cs351\...
Q: On my Mac, I got the kerberos tickets; now how do I get AFS access.
A: Use "aklog" from a terminal window, or use one of the Third Party tools mentioned on the OpenAFS download page for MacOSX.
Q: On my Mac, I can get Kerberos tickets, but running "aklog" gives an error when trying to authenticate to MIT.EDU.
A: For some reason, the OpenAFS installation doesn't give you a chance to change the default cell. The only way I know how to change the default cell is to edit the following file (using "sudo" since it is a system file) and then rebooting:
/var/db/openafs/etc/ThisCellThe contents of this file should be the single line
cs.uwm.eduIf anyone figures out the proper way to do this, let me know.
Q: When I try to get a token, it says "Authentication server not available."
A: Assuming you have network connectivity and all outgoing ports are open, the most likely cause of the problem is that you aren't using the "Network Identity Manager" to get your tokens. You need to download Kerberos for Windows.
Q: lpr says ``permission denied'' when I try to print files!
A: This is because you don't have a PAG (Google "AFS PAG" to get more info).. Workarounds include:
cat filename | lpr -Pe270
Q: I changed my kerberos password using Window's Leash Tool (or Network Identity Manager) and now I can't get 'klog' to work with either the new or old password. Help!
A: The problem is that Leash/NIM uses an encoding technique for your new password that the backward compatibility hack of 'klog' can't handle. The easy way to fix the problem is to log onto weise and use
/usr/afsws/bin/kpasswd.uwmcs ePantherIDThis command handles all encodings but changes the password to use the old encoding. So if you type the new password three times, then 'klog' will work again.