amazon 设计 11 chess

1 public class ChessPieceTurn { };
2 public class GameManager {
3 void processTurn(PlayerBase player) { };
4 boolean acceptTurn(ChessPieceTurn turn) { return true; };
5 Position currentPosition;
6 }
7
8 public abstract class PlayerBase {
9 public abstract ChessPieceTurn getTurn(Position p);
10 }
11 class ComputerPlayer extends PlayerBase {
12 public ChessPieceTurn getTurn(Position p) { return null; }
13 public void setDifficulty() { };
14 public PositionEstimator estimater;
15 public PositionBackTracker backtracter;
16 }
17 public class HumanPlayer extends PlayerBase {
18 public ChessPieceTurn getTurn(Position p) { return null; }
19 }
20
21 public abstract class ChessPieceBase {
22 abstract boolean canBeChecked();
23 abstract boolean isSupportCastle();
24 }
25 public class King extends ChessPieceBase { ... }
26 public class Queen extends ChessPieceBase { ... }
27
28 public class Position { // represents chess positions in compact form
29 ArrayList<ChessPieceBase> black;
30 ArrayList<ChessPieceBase> white;
31 }
32
33 public class PositionBackTracker {
34 public static Position getNext(Position p) { return null; }
35 }
36 public class PositionEstimator {
37 public static PositionPotentialValue estimate(Position p) { ... }
38 }
39 public abstract class PositionPotentialValue {
40 abstract boolean lessThan(PositionPotentialValue pv);
41 }

amazon 设计 11 chess

时间: 2024-08-08 01:22:13

amazon 设计 11 chess的相关文章

amazon 设计 6 parking lot

public abstract class Vehicle { protected ParkingSpace pSpace; public abstract boolean park(ParkingLot pLot); public boolean unpark(ParkingLot pLot)P{ if(pSpace!=null){ pLot.reclaimFreeSpace(pSpace); return true; } return false; } } public class Cars

amazon.设计1. tic tac toe

//不觉中 已经全力找工作好久好久了.大概有1年半了.身心疲惫,不要放弃.曙光快来了. 1.tic tac toe //http://www.ntu.edu.sg/home/ehchua/programming/java/JavaGame_TicTacToe.html 类似相关棋牌坐标对战游戏 一通百通 /** * Enumerations for the various states of the game */ public enum GameState { // to save as "G

amazon 设计 7 genial card game

package card; public class Game implements Runnable{ int numPlayers; int startNumber; //players and hands seperate so players can't change their cards Player player[] = new Player[numPlayers]; Hand hands[] = new Hand[numPlayers]; Card topCard; Deck d

amazon 设计 10 puzzle.

class Edge { enum Type { inner, outer, flat } Piece parent; Type type; boolean fitsWith(Edge type) { }; // Inners & outer fit together. } class Piece { Edge left, right, top, bottom; // 90, 180, etc Orientation solvedOrientation = 90; } class Puzzle

数据库设计——11 个重要的数据库设计规则

简介 在您开始阅读这篇文章之前,我得明确地告诉您,我并不是一个数据库设计领域的大师.以下列出的 11 点是我对自己在平时项目实践和阅读中学习到的经验总结出来的个人见解.我个人认为它们对我的数据库设计提供了很大的帮助.实属一家之言,欢迎拍砖 : ) 我之所以写下这篇这么完整的文章是因为,很多开发者一参与到数据库设计,就会很自然地把 “三范式” 当作银弹一样来使用.他们往往认为遵循这个规范就是数据库设计的唯一标准.由于这种心态,他们往往尽管一路碰壁也会坚持把项目做下去. 如果你对 “三范式” 不清楚

amazon 设计 13 drawboard

public class Drawboard extends JFrame{ Graphics g; public static void main(String[] args){ Drawboard d = new Drawboard(); d.showUI(); } public void showUI(){ Graphics g ; this.setTitle("画图板"); this.setSize(600,600); this.setDefaultCloseOperation

amazon 设计 5 hotel and restaurant reservation system

there I write down the restaurant system. public class TimeSpan { Date date; String start; String end; } public class Table { int tableid; String type; HashMap<Date,HashMap<String,String>> reserved; public boolean isFitToRequest(Request ts){ r

app后端设计(0)--总目录(转)

原文:http://blog.csdn.net/newjueqi/article/details/19003775 做了接近两年app相关的系统架构,api设计,先后在两个创业公司中工作,经历过手机网页端,android客户端,iphone客户端,其中的乐与苦,得与失,仰首问天有谁知?我觉得是时候来个总结,把相关的技术和心得记录下来. 注:这系列文章谈到的经验是根据自身在小型创业团队中总结的,大牛们请飘过^-^ app后端设计(1)--api app后端设计(2)--xmpp的使用 app后端设

app后端设计--总目录 (转)

特此说明,我转载的!!! app后端设计(1)--api app后端设计(2)--xmpp的使用 app后端设计(3)--短信,邮件,推送服务 app后端设计(4)-- 通讯的安全性 app后端设计(5)-- 表情的处理 app后端设计(6)-- LBS app后端设计(7)-- 项目管理 app后端设计(8)-- 数据库分表 app后端设计(9)-- 动态通知 app后端设计(10)--数据增量更新 app后端设计(11)-- 系统架构 app后端设计(12)--图片的处理 app后端设计(1