badbrain.java
来自「一个java的俄罗斯方块实现」· Java 代码 · 共 26 行
JAVA
26 行
package cs111.tetris.brain;import cs111.tetris.data.Board;/** * A joke implementation based on LameBrain -- plays very badly. * <p> * However, badly as it plays, it illustrates how it is possible to implement a new * Brain easily by simply extending LameBrain and overriding the <code>rateBoard</code> * method. */public class BadBrain extends LameBrain { /** * An implementation that is even worse than LameBrain's. * Whatever LameBrain thinks is good is bad and vice versa. * So with this brain, the AI will tend to play the worst * possible move instead of the best. */ public double rateBoard(Board board) { double score = super.rateBoard(board); return 10000 - score; } }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?