// AppliTableur.java
import tableur.CelluleAddition;
import tableur.CelluleConstante;
import tableur.Coord;
import tableur.Tableur;

public class AppliTableur {
  // Affiche le triangle de Pascal
  public static void main(String[] args) {
    final int MAX = 10;
    Tableur t = new Tableur(MAX, MAX);

    t.set(new Coord(0, 0), new CelluleConstante(1));
    for (int i = 1; i < MAX; ++i) {
      t.set(new Coord(i, 0), new CelluleConstante(1));
      for (int j = 1; j <= i - 1; ++j)
        t.set(new Coord(i, j), new CelluleAddition(t, 
            new Coord(i - 1, j - 1), new Coord(i - 1, j)));
      t.set(new Coord(i, i), new CelluleConstante(1));
    }
    System.out.println(t);
  }
}
