Advertisement
daniel_lawson9999

Daniel Lawson Extra - Credit, scaling size of box

Mar 10th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.11 KB | None | 0 0
  1. /**
  2.  * Created by Daniel on 3/9/2016.
  3.  */
  4. public class ExtraCreditV2 {
  5. // v you can change the size of the shape v
  6.     public static int size =  4; // change the value of size to scale up or down, 4 is the default value
  7.  
  8.  
  9.     public static void main (String[] args)
  10.     {
  11.         //System.out.println(size); // test size
  12.         line();
  13.         top();
  14.         bot();
  15.         line();
  16.     }
  17.  
  18.     public static void line ()
  19.     {
  20.         System.out.print("#");
  21.         for (int i = 1; i <= size*4;i++)
  22.         {
  23.             System.out.print("=");
  24.         }
  25.         System.out.println("#");
  26.     }
  27.     // note - If you want to change the value of size, go to the start of the program
  28.     public static void top()
  29.     {
  30.         for (int   line = 1; line <= size; line++)
  31.         {
  32.             System.out.print("|");
  33.             //change = -2,
  34.             for (int j = 1; j <= line * -2 + size*2; j++)
  35.             {
  36.                 System.out.print(" ");
  37.             }
  38.             System.out.print("<>");
  39.  
  40.             for (int j = 1; j <= line * 4 - 4; j++)
  41.             {
  42.                 System.out.print(".");
  43.             }
  44.             System.out.print("<>");
  45.  
  46.             for (int j = 1; j <= line * -2 + size*2; j++)
  47.             {
  48.                 System.out.print(" ");
  49.             }
  50.             System.out.println("|");
  51.  
  52.         }
  53.     }
  54.     // note - If you want to change the value of size, go to the start of the program
  55.     public static void bot()
  56.     {
  57.         for (int line = 1; line <= size;line++)
  58.         {
  59.             System.out.print("|");
  60.  
  61.  
  62.             for (int j = 1; j <= line * 2  - 2; j++ )
  63.                 {
  64.                 System.out.print(" ");
  65.                 }
  66.             System.out.print("<>");
  67.  
  68.             for (int j = 1;j <= line * -4 + size*4;j++)
  69.                 {
  70.                 System.out.print(".");
  71.                 }
  72.             System.out.print("<>");
  73.  
  74.             for (int j = 1; j <= line * 2 - 2 ; j++ )
  75.                 {
  76.                 System.out.print(" ");
  77.                 }
  78.             System.out.println("|");
  79.  
  80.         }
  81.  
  82.  
  83.  
  84.     }
  85.  
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement