So, Continuing from my last homework, I now have to make a package called games.
A package named games. In the package are these types (a type is a class or interface):
A class named Game. This is an abstract class that can be extended to create classes for specific games that are played on a square board, like checkers, chess, and tic-tac-toe. The Game class has one instance variable that is an object in the Board class. Its methods should be public, but its instance of Board should be default. If it has any other instance variables, they should be private.
An interface named Moves. It specifies the methods that are to be implemented by the Board class.
A class named Board that implements Moves. You should be able to use the Board class from the previous assignment with some changes. The Board class and its methods are public, but its variables should be private. In particular, it has an nXn array that represents the game board, and it must be private. The main modifications that you have to make are to allow game pieces of different kinds. For example, in checkers, pieces can be red or black, and they can be regular checkers pieces or kings, giving a total of four kinds of pieces. (You don't need to know what these mean to do this assignment.) Each kind of piece is identified by a unique code. Squares on the game board can be unoccupied or occupied by a single piece of some kind. Use the following codes to indicate the occupancy of a square:
1: red checker
2: black checker
3: red king
4: black king
A class named Checkers, which must be a direct subclass of Game. The Checkers class and its methods should be public, but its variables should be private.
A class named TestCheckers containing a main program that thoroughly tests the Checkers and Board classes. TestCheckers should not be in the package games.
The classes Game, Board and Checkers must satisfy the interfaces given below; that is, you are not free to change the name, type, or behavior of the given methods.
I'm pretty sure I can do the interfaces and whatnot myself. Just let me clear this up, Interfaces are just methods in an Interface right? They don't actually have a definition do they? It's just an empty method..