Advertisement
PurePureMilk

ACSII Art in Java

Sep 13th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.10 KB | None | 0 0
  1. public class Hello
  2. {
  3.  
  4. public static void main(String[] args)
  5. {
  6.  
  7. /*ASCII ART PROJECT
  8. * Draw a creature/animal/figure using ASCII art.
  9.  
  10. The creature must:
  11.  
  12. Be at least 400 square characters with at least 10 characters in one direction
  13. Use each of the escape sequences at least 5 times
  14. Use any other standard ASCII characters.
  15. Your code must follow the style elements
  16. including the use of comments to document the creator, the date, and the purpose.
  17. */
  18.  
  19. /*
  20. * Hello world demos
  21. //System has to Upper-case
  22. //ThinkJava Example... will include and newline command
  23. System.out.println("Using println. Hello, Java!");
  24. //Robert's Example
  25. System.out.print("Using print. Hello, World! ");
  26. //Using escape sequence \n
  27. System.out.print(" Using escape squence. Hello, World\nMs.Robertson");
  28. */
  29.  
  30.  
  31. //Creator: A pirate named PurePureMilk, Date: 9/13/17, Purpose: To get a dumb grade in this class (-_-)
  32. System.out.println("Name: Gabrielle Pham");
  33. System.out.println("Date: 9/13/17");
  34. System.out.println("Period 4 AP Java ;p Bleh (@_@)");
  35. System.out.println("Robertson");
  36. System.out.print("\n");
  37. System.out.println("Title of ASCII Piece: Swords and Treasure Boxes");
  38.  
  39.  
  40. //Pirating a horizontal sword using escape sequence \n
  41. System.out.print(" O\n");
  42. System.out.print(" |\n");
  43. System.out.print("0{XXXX}+====================>\n");
  44. System.out.print(" |\n");
  45. System.out.print(" O\n");
  46.  
  47. System.out.print("\n");
  48.  
  49. //Using random letters to make boxes because and \t \n
  50.  
  51. //o's box
  52. //top
  53. for (int i=0; i < 19; i++)
  54. {
  55. System.out.print("o ");
  56. }
  57. System.out.print("\n");
  58.  
  59. //middle
  60. for (int i=0; i < 5;i++)
  61. {
  62. System.out.print("o\t\t\t\t o\n");
  63. }
  64.  
  65. //bottom
  66. for (int i=0; i < 19; i++)
  67. {
  68. System.out.print("o ");
  69. }
  70. System.out.print("\n");
  71.  
  72. //-'s box 10x
  73. //top
  74. System.out.print("\t");
  75. for (int i=0; i < 11; i++)
  76. {
  77. System.out.print("- ");
  78. }
  79. System.out.print("\n");
  80.  
  81. //middle
  82. for (int e=0; e < 8;e++)
  83. {
  84. System.out.print("\t-\t\t -\n");
  85. }
  86. //bottom
  87. System.out.print("\t");
  88. for (int i=0; i < 11; i++)
  89. {
  90. System.out.print("- ");
  91. }
  92. System.out.print("\n");
  93.  
  94. //Closed box of +'s 37x8
  95. //Nested for loop
  96. for (int e=0; e < 8;e++)
  97. {
  98. for (int i=0; i < 37; i++)
  99. {
  100. System.out.print("+");
  101. }
  102. System.out.print("\n");
  103. }
  104. System.out.print("\n");
  105.  
  106. //Pirating a vertical sword using println and print in the for loop
  107. System.out.println("\t OO");
  108. System.out.println("\tO O");
  109. for (int a=0; a < 11; a++)
  110. {
  111. System.out.print(" | |\n");
  112. }
  113. System.out.print(" | OO |\n");
  114. System.out.print(":O______|O O|______O:\n");
  115. System.out.print(" O__________________O\n");
  116. System.out.print(" | OO |\n");
  117. for (int o = 0; o < 6; o++)
  118. {
  119. System.out.print(" || ||\n");
  120. }
  121. System.out.println(" | OO |");
  122. System.out.println(" O____O");
  123. System.out.println(" (____)");
  124. }
  125.  
  126. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement