Δ CSE Home Δ About Us Δ Search Δ Contact Info

Homework 8 (Critters) FAQ

Why can't I use a for loop?
For the Tiger, I can pick a random direction once, but how do I remember it and do it multiple times?
How do we use something that's passed in to the constructor, in another method?
Why am I getting compiler errors about Point (or some random Java file)?
My CritterMain chokes with lots of compiler errors.
I tried to change color/char/fight/etc. and it compiles, but when I run I still get the default behavior!
Is this Husky 'creative' enough?

Q: Why can't I use a for loop?
A: The simulator asks for a single move. You can only return one move and keep track of what should be returned next time.
Q: For the Tiger, I can pick a random direction once, but how do I remember it and do it multiple times?
A: How do you remember things in classes? Look at the Parent class from lecture.
Q: How do we use something that's passed in to the constructor, in another method?
A: Store it in a field.
Q: Why am I getting compiler errors about Point (or some random Java file)?
A: You are probably saving all of your programs into the same directory. Move Homework 8 into its own directory.
Q: My CritterMain chokes with lots of compiler errors.
A: Make sure that you have copied over the entire file from the web site using "Save As" instead of only copying over the first class (right-click and "Save as").
Q: I tried to change color/char/fight/etc. and it compiles, but when I run I still get the default behavior!
A: Check to make sure the method headers exactly match what is expected. Classes with methods such as "getcolor" (capitalized improperly) or getColor(String critter) (added params) will compile but will be silently ignored; methods with incorrect headers will not properly override the methods from Critter.java.
Q: Is this Husky 'creative' enough?
A: Do you think it is creative?