Skip to main content
Commonmark migration
Source Link

#Java, 209 207 195 191 bytes

Java, 209 207 195 191 bytes

I'm surprised I was able to get it this short. There is probably still room for improvement. As usual, suggestions will be appreciated :)

This returns a char[]. Call using a(n).

char[]a;int b,c,d,e=2;char[]a(int f){java.util.Arrays.fill(a=new char[b=1<<f],'.');for(a[0]=88;d+1<e;c=(d+e)/2,a[c%b]=88)e=b(d=b(b(c)));return a;}int b(int f){for(;;)if(a[++f%b]>87)return f;}

Indented:

char[] a;
int b, c, d, e = 2;

char[] a(int f){
    java.util.Arrays.fill(
            a = new char[
                    b = 1 << f
                    ]
            , '.'
    );
    for(
            a[0] = 88;
            d + 1 < e;
                c = (d + e) / 2,
                a[c % b] = 88
        )
        e = b(
                d = b(
                        b(c)
                )
        );
    return a;
}

int b(int f){
    for (;;)
        if (a[++f % b] > 87)
            return f;
}

12 bytes thanks to Peter :)
4 bytes thanks to TNT ;)

#Java, 209 207 195 191 bytes

I'm surprised I was able to get it this short. There is probably still room for improvement. As usual, suggestions will be appreciated :)

This returns a char[]. Call using a(n).

char[]a;int b,c,d,e=2;char[]a(int f){java.util.Arrays.fill(a=new char[b=1<<f],'.');for(a[0]=88;d+1<e;c=(d+e)/2,a[c%b]=88)e=b(d=b(b(c)));return a;}int b(int f){for(;;)if(a[++f%b]>87)return f;}

Indented:

char[] a;
int b, c, d, e = 2;

char[] a(int f){
    java.util.Arrays.fill(
            a = new char[
                    b = 1 << f
                    ]
            , '.'
    );
    for(
            a[0] = 88;
            d + 1 < e;
                c = (d + e) / 2,
                a[c % b] = 88
        )
        e = b(
                d = b(
                        b(c)
                )
        );
    return a;
}

int b(int f){
    for (;;)
        if (a[++f % b] > 87)
            return f;
}

12 bytes thanks to Peter :)
4 bytes thanks to TNT ;)

Java, 209 207 195 191 bytes

I'm surprised I was able to get it this short. There is probably still room for improvement. As usual, suggestions will be appreciated :)

This returns a char[]. Call using a(n).

char[]a;int b,c,d,e=2;char[]a(int f){java.util.Arrays.fill(a=new char[b=1<<f],'.');for(a[0]=88;d+1<e;c=(d+e)/2,a[c%b]=88)e=b(d=b(b(c)));return a;}int b(int f){for(;;)if(a[++f%b]>87)return f;}

Indented:

char[] a;
int b, c, d, e = 2;

char[] a(int f){
    java.util.Arrays.fill(
            a = new char[
                    b = 1 << f
                    ]
            , '.'
    );
    for(
            a[0] = 88;
            d + 1 < e;
                c = (d + e) / 2,
                a[c % b] = 88
        )
        e = b(
                d = b(
                        b(c)
                )
        );
    return a;
}

int b(int f){
    for (;;)
        if (a[++f % b] > 87)
            return f;
}

12 bytes thanks to Peter :)
4 bytes thanks to TNT ;)

added 27 characters in body
Source Link
TheNumberOne
  • 11.6k
  • 1
  • 38
  • 70

#Java, 209 207 195195 191 bytes

I'm surprised I was able to get it this short. There is probably still room for improvement. As usual, suggestions will be appreciated :)

This returns a char[]. Call using a(n).

char[]a;int b,c=0c,d=0d,e=2;char[]a(int f){java.util.Arrays.fill(a=new char[b=1<<f],'.');for(a[0]=88;d+1<e;c=(d+e)/2,a[c%b]=88)e=b(d=b(b(c)));return a;}int b(int f){for(;;)if(a[++f%b]>87)return f;}

Indented:

char[] a;
int b, c = 0, d = 0, e = 2;

char[] a(int f){
    java.util.Arrays.fill(
            a = new char[
                    b = 1 << f
                    ]
            , '.'
    );
    for(
            a[0] = 88;
            d + 1 < e;
                c = (d + e) / 2,
                a[c % b] = 88
        )
        e = b(
                d = b(
                        b(c)
                )
        );
    return a;
}

int b(int f){
    for (;;)
        if (a[++f % b] > 87)
            return f;
}

12 bytes thanks to Peter :)
4 bytes thanks to TNT ;)

#Java, 209 207 195 bytes

I'm surprised I was able to get it this short. There is probably still room for improvement. As usual, suggestions will be appreciated :)

This returns a char[]. Call using a(n).

char[]a;int b,c=0,d=0,e=2;char[]a(int f){java.util.Arrays.fill(a=new char[b=1<<f],'.');for(a[0]=88;d+1<e;c=(d+e)/2,a[c%b]=88)e=b(d=b(b(c)));return a;}int b(int f){for(;;)if(a[++f%b]>87)return f;}

Indented:

char[] a;
int b, c = 0, d = 0, e = 2;

char[] a(int f){
    java.util.Arrays.fill(
            a = new char[
                    b = 1 << f
                    ]
            , '.'
    );
    for(
            a[0] = 88;
            d + 1 < e;
                c = (d + e) / 2,
                a[c % b] = 88
        )
        e = b(
                d = b(
                        b(c)
                )
        );
    return a;
}

int b(int f){
    for (;;)
        if (a[++f % b] > 87)
            return f;
}

12 bytes thanks to Peter :)

#Java, 209 207 195 191 bytes

I'm surprised I was able to get it this short. There is probably still room for improvement. As usual, suggestions will be appreciated :)

This returns a char[]. Call using a(n).

char[]a;int b,c,d,e=2;char[]a(int f){java.util.Arrays.fill(a=new char[b=1<<f],'.');for(a[0]=88;d+1<e;c=(d+e)/2,a[c%b]=88)e=b(d=b(b(c)));return a;}int b(int f){for(;;)if(a[++f%b]>87)return f;}

Indented:

char[] a;
int b, c, d, e = 2;

char[] a(int f){
    java.util.Arrays.fill(
            a = new char[
                    b = 1 << f
                    ]
            , '.'
    );
    for(
            a[0] = 88;
            d + 1 < e;
                c = (d + e) / 2,
                a[c % b] = 88
        )
        e = b(
                d = b(
                        b(c)
                )
        );
    return a;
}

int b(int f){
    for (;;)
        if (a[++f % b] > 87)
            return f;
}

12 bytes thanks to Peter :)
4 bytes thanks to TNT ;)

added 10 characters in body
Source Link
TheNumberOne
  • 11.6k
  • 1
  • 38
  • 70

#Java, 209 207207 195 bytes

I'm surprised I was able to get it this short. There is probably still room for improvement. As usual, suggestions will be appreciated :)

This returns a char[]. Call using a(n).

char[]a;int b,c=0,d=0,e=2;char[]a(int f){java.util.Arrays.fill(a=new char[b=1<<f],'.');for(a[0]=88;d+1<e;c=(d+e)/2,a[(c%b+b)%b]=88a[c%b]=88)e=b(d=b(b(c)));return a;}int b(int f){for(;;)if(a[(++f%b+b)%b]>87a[++f%b]>87)return f;}

Indented:

char[] a;
int b, c = 0, d = 0, e = 2;

char[] a(int f){
    java.util.Arrays.fill(
            a = new char[
                    b = 1 << f
                    ]
            , '.'
    );
    for(
            a[0] = 88;
            d + 1 < e;
                c = (d + e) / 2,
                a[(c % b + b)a[c % b] = 88
        )
        e = b(
                d = b(
                        b(c)
                )
        );
    return a;
}

int b(int f){
    for (;;)
        if (a[(++f % b + b)a[++f % b] > 87)
            return f;
}

12 bytes thanks to Peter :)

#Java, 209 207 bytes

I'm surprised I was able to get it this short. There is probably still room for improvement. As usual, suggestions will be appreciated :)

This returns a char[]. Call using a(n).

char[]a;int b,c=0,d=0,e=2;char[]a(int f){java.util.Arrays.fill(a=new char[b=1<<f],'.');for(a[0]=88;d+1<e;c=(d+e)/2,a[(c%b+b)%b]=88)e=b(d=b(b(c)));return a;}int b(int f){for(;;)if(a[(++f%b+b)%b]>87)return f;}

Indented:

char[] a;
int b, c = 0, d = 0, e = 2;

char[] a(int f){
    java.util.Arrays.fill(
            a = new char[
                    b = 1 << f
                    ]
            , '.'
    );
    for(
            a[0] = 88;
            d + 1 < e;
                c = (d + e) / 2,
                a[(c % b + b) % b] = 88
        )
        e = b(
                d = b(
                        b(c)
                )
        );
    return a;
}

int b(int f){
    for (;;)
        if (a[(++f % b + b) % b] > 87)
            return f;
}

#Java, 209 207 195 bytes

I'm surprised I was able to get it this short. There is probably still room for improvement. As usual, suggestions will be appreciated :)

This returns a char[]. Call using a(n).

char[]a;int b,c=0,d=0,e=2;char[]a(int f){java.util.Arrays.fill(a=new char[b=1<<f],'.');for(a[0]=88;d+1<e;c=(d+e)/2,a[c%b]=88)e=b(d=b(b(c)));return a;}int b(int f){for(;;)if(a[++f%b]>87)return f;}

Indented:

char[] a;
int b, c = 0, d = 0, e = 2;

char[] a(int f){
    java.util.Arrays.fill(
            a = new char[
                    b = 1 << f
                    ]
            , '.'
    );
    for(
            a[0] = 88;
            d + 1 < e;
                c = (d + e) / 2,
                a[c % b] = 88
        )
        e = b(
                d = b(
                        b(c)
                )
        );
    return a;
}

int b(int f){
    for (;;)
        if (a[++f % b] > 87)
            return f;
}

12 bytes thanks to Peter :)

added 2 characters in body
Source Link
TheNumberOne
  • 11.6k
  • 1
  • 38
  • 70
Loading
Source Link
TheNumberOne
  • 11.6k
  • 1
  • 38
  • 70
Loading