Exemplo n.º 1
0
  /** Let the computer player take its turn. */
  public void computerPlay() {
    computerArea.setName("Thinking!");
    computerArea.paintImmediately(computerArea.getVisibleRect());
    int minLength = myBoardSize == 4 ? 3 : 4;
    computerPlayer.findAllValidWords(myBoard, myLexicon, minLength);

    computerArea.setName("Computer");
    for (String s : computerPlayer) {
      computerArea.showWord(s, myFinder.cellsForWord(myBoard, s), computerPlayer);
    }
    myBoardPanel.unHighlightAllDice(); // leave board unhighlighted when
    // done
  }
Exemplo n.º 2
0
 private void initPlayers(IAutoPlayer compPlayer) {
   computerPlayer = compPlayer;
   computerPlayer.setView(computerArea);
   humanPlayer = new HumanPlayer("Human");
   humanPlayer.setView(humanArea);
 }