package com.thoughtworks.main;

public class Main {

    public void printSingleAsterisk() {
        System.out.println("*");
    }

    public void printHorizontalLine(int n) {
        for (int i = 0; i < n; i++) {
            System.out.print("*");
        }
    }

    public void printVerticalLine(int n) {
        for (int i = 0; i < n; i++) {
            System.out.println("*");
        }
    }

    public void printRightTriangle(int n) {
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < i + 1; j++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }

    public void printIsoscelesTriangle(int n) {
        int asteriskCount = 1;
        for (int i = 0; i < n; i++) {
            for (int j = n - 1; j > i; j--) {
                System.out.print(" ");
            }
            for (int j = 0; j < asteriskCount; j++) {
                System.out.print("*");
            }
            System.out.println();
            asteriskCount += 2;
        }
    }

    public void printDiamond(int n) {
        int asteriskCount = 1;
        for (int i = 0; i < n; i++) {
            for (int j = n - 1; j > i; j--) {
                System.out.print(" ");
            }
            for (int j = 0; j < asteriskCount; j++) {
                System.out.print("*");
            }
            System.out.println();
            asteriskCount += 2;
        }

        asteriskCount -= 4;

        for (int i = 0; i < n - 1; i++) {
            for (int j = 0; j < i + 1; j++) {
                System.out.print(" ");
            }
            for (int j = 0; j < asteriskCount; j++) {
                System.out.print("*");
            }
            System.out.println();
            asteriskCount -= 2;
        }
    }

    public void printDiamondWithName(int n, String name) {
        int asteriskCount = 1;
        for (int i = 0; i < n - 1; i++) {
            for (int j = n - 1; j > i; j--) {
                System.out.print(" ");
            }
            for (int j = 0; j < asteriskCount; j++) {
                System.out.print("*");
            }
            System.out.println();
            asteriskCount += 2;
        }

        System.out.println(name);
        asteriskCount -= 2;

        for (int i = 0; i < n - 1; i++) {
            for (int j = 0; j < i + 1; j++) {
                System.out.print(" ");
            }
            for (int j = 0; j < asteriskCount; j++) {
                System.out.print("*");
            }
            System.out.println();
            asteriskCount -= 2;
        }
    }


    public static void main(String[] args) {
        Main main = new Main();

        main.printSingleAsterisk();
        main.printHorizontalLine(5);
        main.printVerticalLine(5);
        main.printRightTriangle(5);
        main.printIsoscelesTriangle(5);
        main.printDiamond(5);
        main.printDiamondWithName(3, "arun");
//        main.fizzBuzz();
//        System.out.println(main.generate(625));
    }
}

@@ -2593,16 +2593,442 @@
 %0A    %7D%0A%0A
+    public void fizzBuzz() %7B%0A        for (int i = 1; i %3C 100; i++) %7B%0A            if((i %25 3 == 0) && (i %25 5 == 0)) %7B%0A                System.out.println(%22FizzBuzz%22);%0A            %7D else if(i %25 3 == 0) %7B%0A                System.out.println(%22Fizz%22);%0A            %7D%0A            else if(i %25 5 == 0) %7B%0A                System.out.println(%22Buzz%22);%0A            %7D else %7B%0A                System.out.println(i);%0A            %7D%0A        %7D%0A    %7D%0A
 %0A    pub
@@ -3358,18 +3358,16 @@
 arun%22);%0A
-//
         

Complete Fizz Buzz