/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Extra;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;

/**
 *
 * @author felix
 */
public class prueba {
    static public void main(String args[]){
        Random r = new Random();
        ArrayList <Circulo> circulos = new ArrayList<Circulo>();
        int i;
        
        for(i=0; i<100; i++) 
            circulos.add(new Circulo(0, 0, (float) Math.abs(1000.0*r.nextDouble())));     
    
        for (Circulo c: circulos)
            System.out.println(c);
        
        Collections.sort(circulos, new Ordena());

        System.out.println("\nOrdenados \n");
        
        for (Circulo c: circulos)
            System.out.println(c);
        
        for(int ren=1; ren<10; ren++){
            for(int col=0; col<ren; col++) {
                System.out.print(Triangulo(ren, col) + " ");
            }
            System.out.println("");
        }
    }
    
    static public int Triangulo(int ren, int col) {
        if(ren == 0) return 1;
        if(col == 0) return 1;
        if(col >= ren) return 0;
        
        return Triangulo(ren-1, col) + Triangulo(ren-1, col-1);
        
    }
}
