User Tools

Site Tools


resources_for_connectfour

Connect 4

Make a class called Piece with the following instance variables:

  1. color (use a import java.awt.Color)
  2. row
  3. column

A Connect4 Piece is either Color.RED or Color.BLACK

Make a Constructor with three parameters in the same order listed above

Make the following methods:

  1. setColor
  2. getColor
  3. setRow
  4. getRow
  5. setCol
  6. getCol
  7. setLocation(int row, int col)
  8. toString
  9. equals(Piece other) which returns true if the other Piece is the same Color

Add this class in a Java Project with the following classes:

resources_for_connectfour.txt · Last modified: 2022/05/10 18:23 by frchris

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki