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 void fizzBuzz() {
        for (int i = 1; i < 100; i++) {
            if((i % 3 == 0) && (i % 5 == 0)) {
                System.out.println("FizzBuzz");
            } else if(i % 3 == 0) {
                System.out.println("Fizz");
            }
            else if(i % 5 == 0) {
                System.out.println("Buzz");
            } else {
                System.out.println(i);
            }
        }
    }

    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));
    }
}

@@ -25,16 +25,69 @@
 .main;%0A%0A
+%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A
 public c
@@ -2729,16 +2729,17 @@
       if
+ 
 ((i %25 3 
@@ -2759,24 +2759,24 @@
  5 == 0)) %7B%0A
-
             
@@ -2828,24 +2828,25 @@
    %7D else if
+ 
 (i %25 3 == 0)
@@ -2909,28 +2909,16 @@
    %7D
-%0A           
  else if
 (i %25
@@ -2913,16 +2913,17 @@
  else if
+ 
 (i %25 5 =
@@ -3056,32 +3056,493 @@
        %7D%0A    %7D%0A%0A
+    public List%3CInteger%3E generate(int n) %7B%0A        List%3CInteger%3E primeFactors = new ArrayList%3C%3E();%0A        while(n %25 2 == 0) %7B%0A            primeFactors.add(2);%0A            n /= 2;%0A        %7D%0A%0A        for (int i = 3; i %3C Math.sqrt(n); i += 2) %7B%0A            while(n %25 i == 0) %7B%0A                primeFactors.add(i);%0A                n /= i;%0A            %7D%0A        %7D%0A%0A        if(n %3E 1) %7B%0A            primeFactors.add(n);%0A        %7D%0A%0A        return primeFactors;%0A    %7D%0A%0A
     public stati
@@ -3892,10 +3892,8 @@
 ();%0A
-//
     
@@ -3933,11 +3933,10 @@
 ate(
-625
+30
 ));%0A

Complete prime factors generation