Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ASCIIWindow {
- public static void main(String[] args) {
- final int SIZE=3;
- // Produces Top Line
- System.out.print("+");
- for (int i = 1; i <= 2; i++) {
- for (int line = 1; line <= SIZE; line++) {
- System.out.print("=");
- }
- System.out.print("+");
- }
- System.out.println();
- // Produces Top Fill
- for (int fill = 1; fill <= SIZE; fill++) {
- System.out.print("|");
- for (int bar = 1; bar <= 2; bar++) {
- for (int space = 1; space <= SIZE; space++) {
- System.out.print(" ");
- }
- System.out.print("|");
- }
- System.out.println();
- }
- // Produces Middle Line
- System.out.print("+");
- for (int i = 1; i <= 2; i++){
- for (int line = 1; line <= SIZE; line++) {
- System.out.print("=");
- }
- System.out.print("+");
- }
- System.out.println();
- // Produces Bottom Fill
- for (int fill = 1; fill <= SIZE; fill++) {
- System.out.print("|");
- for (int bar = 1; bar <= 2; bar++) {
- for (int space = 1; space <= SIZE; space++) {
- System.out.print(" ");
- }
- System.out.print("|");
- }
- System.out.println();
- }
- // Produces Bottom Line
- System.out.print("+");
- for (int i = 1; i <= 2; i++){
- for (int line = 1; line <= SIZE; line++) {
- System.out.print("=");
- }
- System.out.print("+");
- }
- System.out.println();
- }
- }
Add Comment
Please, Sign In to add comment