Tuesday, August 14, 2007

What Angle Does Three Make?

Am sure you guessed the answer, a triangle. Take three edges and join them by their edges, what you get is a triangle. Measure the angle if you can. We're following up on our staircase faces to build a triangle. You just have to think in alternation. How? Twist the stairs 180 degrees to the left, leave the first one remaining and voila!, you have a triangle. That's what three makes. Now four? A Mahjong game; read my lips, there is even a Mahjong messenger online. Officially. But if you go for poker...



/*
*TRY DOING A DIAMOND AFTER THIS CODE
* :-)
*/
package overall;

public class AtTriangle {

public static void main(String[] args){
//@ character unicode representation as char
char c = '\u0040';
//declaring our array
char[][] atTriangleArray;
//we now allocate only the rows
atTriangleArray = new char[6][];
//next the columns are allocated
for (int i=0; i<atTriangleArray.length; i++){
//for the six rows there are eleven columns
atTriangleArray[i] = new char[11];
//if this is the first column assign at to the
//6th column
switch(i){
case 0: atTriangleArray[i][5] =c; break;
case 1: atTriangleArray[i][4] =c;
atTriangleArray[i][5] =c;
atTriangleArray[i][6] =c;
break;
case 2: atTriangleArray[i][3] =c;
atTriangleArray[i][4] =c;
atTriangleArray[i][5] =c;
atTriangleArray[i][6] =c;
atTriangleArray[i][7] =c;
break;
case 3: atTriangleArray[i][2] =c;
atTriangleArray[i][3] =c;
atTriangleArray[i][4] =c;
atTriangleArray[i][5] =c;
atTriangleArray[i][6] =c;
atTriangleArray[i][7] =c;
atTriangleArray[i][8] =c;
break;
case 4: atTriangleArray[i][1] =c;
atTriangleArray[i][2] =c;
atTriangleArray[i][3] =c;
atTriangleArray[i][4] =c;
atTriangleArray[i][5] =c;
atTriangleArray[i][6] =c;
atTriangleArray[i][7] =c;
atTriangleArray[i][8] =c;
atTriangleArray[i][9] =c;
break;
case 5: atTriangleArray[i][0] =c;
atTriangleArray[i][1] =c;
atTriangleArray[i][2] =c;
atTriangleArray[i][3] =c;
atTriangleArray[i][4] =c;
atTriangleArray[i][5] =c;
atTriangleArray[i][6] =c;
atTriangleArray[i][7] =c;
atTriangleArray[i][8] =c;
atTriangleArray[i][9] =c;
atTriangleArray[i][10] = c;
break;
default : break;
}
}
for(int i=0; i<atTriangleArray.length;i++){
for(int j=0; j<atTriangleArray[i].length; j++){
System.out.print(atTriangleArray[i][j]);
}
System.out.println();
}
}
}

Life is easy when you're on rails, especially when you are three: you, your girl beside you and your dog. I'd take a vacation to anywhere i'd call home. Now if you mind my talking about a home, I've been watching the prices of some real estate here. I can tell you without blinking that they are SPECIAL OFFERS and for you.

No comments: