GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — chess-java/Rook.java at main · lindazeng979/chess-java Expand file tree/ Copy pathRook.javaMore file actions 44 lines (42 loc) · 955 Bytes / Copy pathRook.javaFile metadata and controls44 lines (42 loc) · 955 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 import java.awt.Color; import java.util.*; /** * Represents a rook in chess. * * @author Linda Zeng * @version 4.9.23 */ public class Rook extends Piece { /** * Constructs a rook * with given color and filename. * It is valued at 5 * * @param col color of rook * @param fileName file with image of rook */ public Rook(Color col, String filename) { super(col, filename, 5); } /** * Indicates which locations * the rook can move to. * Can move up and down * and left and right. * * @return an ArrayList of * locations this can * move to */ public ArrayList<Location> destinations() { ArrayList<Location> res = new ArrayList<Location>(); sweep(res, Location.NORTH); sweep(res, Location.SOUTH); sweep(res, Location.WEST); sweep(res, Location.EAST); return res; } } |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |