Skip to main content
2 of 2
added 3 characters in body
Marco13
  • 1.2k
  • 6
  • 9

Java, 181

I hope that according to

You are permitted to write a full program or a function.

it is compliant to the rules to count the bytes of the function, which is 181 in this case

import static java.lang.System.*;
public class Boxes
{
    public static void main(String[] args)
    {
        Boxes b=new Boxes();
        System.out.println("1,1:");
        b.b(1,1);
        System.out.println("1,2:");
        b.b(1,2);
        System.out.println("2,1:");
        b.b(2,1);
        System.out.println("2,2:");
        b.b(2,2);
        System.out.println("2,5:");
        b.b(2,5);
    }
    
    void b(int R, int C){String s="",e=s,x,y,z=s,a="====",n="=\n";int r,c;for(r=R;r-->0;){x=y=e;for(c=C;c-->0;){x+=a;y+="=   ";}s+=x+n+y+n;}for(c=C;c-->0;){z+=a;}s+=z+n;out.println(s);}
}
Marco13
  • 1.2k
  • 6
  • 9