Hi everyone, I'm currently having an assignment in which my instructors want students to "understand" and interpret Javadocs, then write the methods and constructors back from them. Right now I'm stuck at these last two and I would like to ask you guys for suggestions.
[B]Constructor Detail[/B] DogAndCat public DogAndCat(int size) Creates a grid of squares with height and width both equal to the given size; each square is constructed with the appropriate status (cat, dog, or a vacant spot) for starting a game. The starting configuration consists of a vacant square in the center and the remaining square being half occupied by cats and half occupied by dogs. Each (vertical) column with a higher index than the middle column starts with all cats, and each column with an index lower than the middle column starts with all dogs. The center column has cats in the low row indices, dogs in the high row indices, and a vacant spot in the middle. The legal range of size is odd numbers from 3 up to 9, which is assumed by the constructor as a precondition.
and another Javadocs (this time for a method called "isSolved" :
isSolved public boolean isSolved() Indicates whether or not all lily pads in the pond are in the solved state. Returns: true if the puzzle is solved and false otherwise.
He was asking us to write a cat and dog game, where you can find an example here : Toads And Frogs puzzle in two dimensions (actually the one in the example are frogs and toads, but he changes it to cats and dogs lol). I don't know what to put inside the constructor, as well as "isSolved" method. How could one know when is the problem solved? I'm really confused right now. Any help is appreciated. Thank you.