Dimond shape

PHOTO EMBED

Wed Apr 19 2023 13:44:00 GMT+0000 (Coordinated Universal Time)

Saved by @Mohamedshariif #java

#================#
|      <><>      |
|    <>....<>    |
|  <>........<>  |
|<>............<>|
|<>............<>|
|  <>........<>  |
|    <>....<>    |
|      <><>      |
#================#
  
  
  public static void main(String[] args) {
        topHalf();
        bottomHalf();
    }
    public static void topHalf() {
        
        System.out.println("#================#");
        
    for ( int line = 1; line <=4; line ++)
    {
        System.out.print("|");
        for(int space = 1; space <= ( line * - 2 + 8); space ++)
        {
            System.out.print(" ");
        }
        System.out.print("<>");
        for(int dot = 1; dot <= (4 * line -4); dot ++)
        {
            System.out.print(".");
        }
        System.out.print("<>");
        for(int space = 1; space <= (line * - 2 + 8); space ++)
        {
            System.out.print(" ");
        }
        System.out.println("|");
    }
}
    public static void bottomHalf() {
        for(int line = 1; line <=4; line ++)
        {
            System.out.print("|");
            for(int space = 1; space <= ( 2 * line -2); space ++)
                {
                    System.out.print(" ");
                }
            System.out.print("<>");
            for(int dot = 1; dot <=( -4 * line + 16); dot ++)
            {
                System.out.print(".");
            }
            System.out.print("<>");
            for(int space = 1; space <= ( 2 * line -2); space++)
            {
                System.out.print(" ");
            }
            System.out.println("|");
        }
        System.out.print("#================#");
    }
}

content_copyCOPY