Exemple #1
0
 public void SetChain(int position, Entry neighbor)
 {
     if(neighbor == null || neighbor.Color != this.Color)
         return;
     
     if (position < 0 || position > 3)
         throw new ArgumentException("Position must be within 0 and 5");
     chains[position] = neighbor.GetChain(position) + 1;
 }
Exemple #2
0
        public Checker Move(Checker checker, int column)
        {
            if (Board[0, column] != null)
                throw new ArgumentException("Column is full");

            for(int i = 5; i >= 0; i--)
            {
                if(Board[i,column] == null)
                {
                    Board[i, column] = new Entry(checker);
                    break;
                }
            }

            return this.ValidateBoard();
        }