Advertisement
Nikigeorg1

FlagWithColors

Feb 21st, 2020
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.15 KB | None | 0 0
  1. import java.sql.Array;
  2. import java.util.Arrays;
  3. import java.util.Scanner;
  4.  
  5. public class FlagProgramm {
  6.     public static void main(String[] args) {
  7.  
  8.         char symbol1 = '*';
  9.         char symbol2 = '+';
  10.         char symbol3 = '-';
  11.         char symbol4 = '/';
  12.         char symbol5 = '\u2588';
  13.         char symbol6 = '\u1234';
  14.         String color1 = "\033[32m";
  15.         String color2 = "\033[31m";
  16.         String color3 = "\033[30m";
  17.         char[] array;
  18.         System.out.println("Enter how long to be flag : ");
  19.         Scanner scan = new Scanner(System.in);
  20.         int flagLength = scan.nextInt();
  21.         array = new char[flagLength];
  22.         Arrays.fill(array,symbol1);
  23.         System.out.println(array);
  24.         Arrays.fill(array,symbol2);
  25.         System.out.print(color1);
  26.         System.out.println(array);
  27.         Arrays.fill(array,symbol3);
  28.         System.out.println(array);
  29.         System.out.print(color2);
  30.         Arrays.fill(array,symbol4);
  31.         System.out.println(array);
  32.         Arrays.fill(array,symbol5);
  33.         System.out.println(array);
  34.         Arrays.fill(array,symbol6);
  35.         System.out.println(array);
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement