/**
 * @author Daniel "3ICE" Berezvai
 */
public class Calculator4 {
	public static void loadInputs(String[] args){
		a=Integer.parseInt(args[1]);
		String[] s=args[0].split(",");
		b=new int[s.length];
		for(int i=0;i<s.length;i++){
			b[i]=Integer.parseInt(s[i]);
		}
		v=new Vector2(b);
	}

static int a;
static int[] b;
static Vector2 v;
	public static void main(String[] args) {
		if(args.length!=2){
			System.out.println("Hello, please give me two command line arguments.");
		}else{
			loadInputs(args);
			v.add(a);
			v.show();
			System.out.println("Adding this result to itself:");
			v.addVector(v).show();
			System.out.println();
			
			System.out.println("Now calculating scalar product with itself:");
			System.out.println(v.scalarProd(v));
			System.out.println();
			
			System.out.println("Adding vectors with different size (bonus):");
			Vector2 small=new Vector2(new int[]{3,6,9});
			Vector2 big=new Vector2(new int[]{-2,-4,-7,1,3});
			small.show();
			System.out.println("+");
			big.show();
			System.out.println("=");
			small.addVector(big).show();
			//3ICE: Equivalent to: big.addVector(small).show();
			System.out.println();
			System.out.println("Again:");
			Vector2 big2=new Vector2(new int[]{-1,3,5,7,9});
			Vector2 small2=new Vector2(new int[]{2,-9});
			big2.show();
			System.out.println("+");
			small2.show();
			System.out.println("=");
			big2.addVector(small2).show();
		}
	}
}
