import java.util.Scanner;
public class Main
{
public static void main(String[] args){
Scanner input = new Scanner(System.in);
int x = 0; // input height
int choice;
System.out.println("1. Trapezoid ");
System.out.println("2. Diamaond ");
System.out.println("3. Hollow Triangle ");
System.out.println("What kind of shape do you want to see? ");
choice = input.nextInt(); // user chooses shape
if(choice==1){
System.out.print("Enter height: ");
x = input.nextInt(); //user inputs height
drawTrapezoid(x);
} else if(choice == 2){
System.out.print("Enter height: ");
x = input.nextInt(); //user inputs height
drawDiamond(x);
} else if(choice == 3){
System.out.print("Enter height: ");
x = input.nextInt(); //user inputs height
//drawHollowTriangle(x,mark);
}
}
public static void drawbDiamond(int length){
for(int j = 1; j<=length; j++){
System.out.print('x');
}
}
public static void drawbDiamond(int length, char mark){
for(int j = 1; j<=length; j++){
System.out.print(mark);
}
}
public static void drawbDiamondln(int length){
drawbDiamond(length);
System.out.println();
}
public static void drawbDiamondln(int length, char mark){
drawbDiamond(length,mark);
System.out.println();
}
public static void drawDiamond(int x){
int dotspace = x - 1;
int xstars = 1;
do{ //first half of diamond
drawbDiamond(dotspace,'.');
drawbDiamondln(xstars);
dotspace--;
xstars+=2;
} while(dotspace>=0);
do{
drawbDiamond(dotspace, '.');
drawbDiamondln(xstars);
dotspace++;
xstars-=2;
} while(dotspace<=xstars);
}
// TRAPEZOID
public static void drawbTrapezoid(int length){
for(int i = 1; i<=length; i++){
System.out.print('x');
}
}
public static void drawbTrapezoid(int length, char mark){
for(int i = 1; i<=length; i++){
System.out.print(mark);
}
}
public static void drawbTrapezoidln(int length){
drawbTrapezoid(length);
System.out.println();
}
public static void drawbTrapezoidln(int length, char mark){
for(int i = 1; i<=length; i++){
drawbTrapezoid(length,mark);
}
}
public static void drawTrapezoid(int x){
int dotspace = x - 1;
int xstars = 2 * x - 1;
do{
drawbTrapezoid(dotspace, '.');
drawbTrapezoidln(xstars);
dotspace--;
xstars+=2;
} while(dotspace>=0);
}
}