All pastes #568284 Raw Edit

nbl

public java v1 · immutable
·published 2007-06-15 13:26 UTC
rendered paste body
      int[] playerRoll = new int[thePlayers.size()];		      for(int k = 0; k <thePlayers.size(); k++)		{						playerRoll[k] = theDice.roll();			while(isTie(k, playerRoll ) {                            playerRoll[k] = theDice.roll();                        }							}.......................private boolean isTie(int playerIndex, int playersRoll) {  for(int i=0; i < players.size(); i++) {     if(i != playerIndex && playersRoll[i] == playersRoll[playerIndex])         return true;  }  return false;}