Skip to main content
added 452 characters in body
Source Link
Olivier Grégoire
  • 14.4k
  • 3
  • 32
  • 56

Java, 196 136134 bytes

String a(){String r="";for(int i=0;i<26;i++){for(int j=0;j<25-i;j++)r+=" ";for(char c=(char)('Z'-i);c>=65;c--)r+=c;r+="\n";}return r;}
String a(){String r="";for(int i=0;i<26;i++){for(int j=0;j<25-i;j++)r+=" ";for(char c=(char)('Z'-i);c>=65;c--)r+=c;r+="\n";}return r;}

Try it online!

String a() {
    String r = "";
    for (int i = 0; i < 26; i++) {
        for (int j = 0; j < 25 - i; j++)
            r += " ";
        for (char c = (char)('Z'-i); c >= 65; c--)
            r += c; r+= "\n";
    }
    return r;
}
String a() {
    String r = "";
    for (int i = 0; i < 26; i++) {
        for (int j = 0; j < 25 - i; j++)
            r += " ";
        for (char c = (char)('Z'-i); c >= 65; c--)
            r += c; r+= "\n";
    }
    return r;
}

Java, 196 136 bytes

String a(){String r="";for(int i=0;i<26;i++){for(int j=0;j<25-i;j++)r+=" ";for(char c=(char)('Z'-i);c>=65;c--)r+=c;r+="\n";}return r;}
String a() {
    String r = "";
    for (int i = 0; i < 26; i++) {
        for (int j = 0; j < 25 - i; j++)
            r += " ";
        for (char c = (char)('Z'-i); c >= 65; c--)
            r += c; r+= "\n";
    }
    return r;
}

Java, 196 134 bytes

String a(){String r="";for(int i=0;i<26;i++){for(int j=0;j<25-i;j++)r+=" ";for(char c=(char)('Z'-i);c>=65;c--)r+=c;r+="\n";}return r;}

Try it online!

String a() {
    String r = "";
    for (int i = 0; i < 26; i++) {
        for (int j = 0; j < 25 - i; j++)
            r += " ";
        for (char c = (char)('Z'-i); c >= 65; c--)
            r += c; r+= "\n";
    }
    return r;
}
formatting
Source Link

Java, 196 136 bytes

Yes, this has no chance of winning overall, but it helps to re-familiarize myself with the language. Any improvements are welcome, but know I have not yet had time to read the Tips or Golfing in Java.

``public class A{public static void main(String[]a){for(int i=0;i<26;i++){for(int j=0;j<25-i;j++)System.out.print(" ");for(char c=(char)(90-i);c>=65;c--)System.out.print(c);System.out.println();}}}```public class A{public static void main(String[]a){for(int i=0;i<26;i++){for(int j=0;j<25-i;j++)System.out.print(" ");for(char c=(char)(90-i);c>=65;c--)System.out.print(c);System.out.println();}}}

Thanks to JollyJoker for suggesting improvements. I won't get a chance to investigate lambdas for this one, but I'll remember it for the future. This is as short as I'll make this one. Eclipse kept complaining when I changed all ints to chars, so I'll look into that some more.

String a(){String r="";for(int i=0;i<26;i++){for(int j=0;j<25-i;j++)r+=" ";for(char c=(char)('Z'-i);c>=65;c--)r+=c;r+="\n";}return r;}

Ungolfed:

public class A { public static void main(String[] args) { for (int i = 0; i < 26; i++) { for (int j = 0; j < 25 - i; j++) System.out.print(" "); for (char c = (char)(90 - i); c> = 65; c--) System.out.print(c); System.out.println(); } } }

String a() {
    String r = "";
    for (int i = 0; i < 26; i++) {
        for (int j = 0; j < 25 - i; j++)
            r += " ";
        for (char c = (char)('Z'-i); c >= 65; c--)
            r += c; r+= "\n";
    }
    return r;
}

Java, 196 136 bytes

Yes, this has no chance of winning overall, but it helps to re-familiarize myself with the language. Any improvements are welcome, but know I have not yet had time to read the Tips or Golfing in Java.

``public class A{public static void main(String[]a){for(int i=0;i<26;i++){for(int j=0;j<25-i;j++)System.out.print(" ");for(char c=(char)(90-i);c>=65;c--)System.out.print(c);System.out.println();}}}```

Thanks to JollyJoker for suggesting improvements. I won't get a chance to investigate lambdas for this one, but I'll remember it for the future. This is as short as I'll make this one. Eclipse kept complaining when I changed all ints to chars, so I'll look into that some more.

String a(){String r="";for(int i=0;i<26;i++){for(int j=0;j<25-i;j++)r+=" ";for(char c=(char)('Z'-i);c>=65;c--)r+=c;r+="\n";}return r;}

Ungolfed:

public class A { public static void main(String[] args) { for (int i = 0; i < 26; i++) { for (int j = 0; j < 25 - i; j++) System.out.print(" "); for (char c = (char)(90 - i); c> = 65; c--) System.out.print(c); System.out.println(); } } }

String a() {
    String r = "";
    for (int i = 0; i < 26; i++) {
        for (int j = 0; j < 25 - i; j++)
            r += " ";
        for (char c = (char)('Z'-i); c >= 65; c--)
            r += c; r+= "\n";
    }
    return r;
}

Java, 196 136 bytes

Yes, this has no chance of winning overall, but it helps to re-familiarize myself with the language. Any improvements are welcome, but know I have not yet had time to read the Tips or Golfing in Java.

public class A{public static void main(String[]a){for(int i=0;i<26;i++){for(int j=0;j<25-i;j++)System.out.print(" ");for(char c=(char)(90-i);c>=65;c--)System.out.print(c);System.out.println();}}}

Thanks to JollyJoker for suggesting improvements. I won't get a chance to investigate lambdas for this one, but I'll remember it for the future. This is as short as I'll make this one. Eclipse kept complaining when I changed all ints to chars, so I'll look into that some more.

String a(){String r="";for(int i=0;i<26;i++){for(int j=0;j<25-i;j++)r+=" ";for(char c=(char)('Z'-i);c>=65;c--)r+=c;r+="\n";}return r;}

Ungolfed:

public class A { public static void main(String[] args) { for (int i = 0; i < 26; i++) { for (int j = 0; j < 25 - i; j++) System.out.print(" "); for (char c = (char)(90 - i); c> = 65; c--) System.out.print(c); System.out.println(); } } }

String a() {
    String r = "";
    for (int i = 0; i < 26; i++) {
        for (int j = 0; j < 25 - i; j++)
            r += " ";
        for (char c = (char)('Z'-i); c >= 65; c--)
            r += c; r+= "\n";
    }
    return r;
}
removed an errant set of parenthesis
Source Link

Java, 196 136 bytes

Yes, this has no chance of winning overall, but it helps to re-familiarize myself with the language. Any improvements are welcome, but know I have not yet had time to read the Tips or Golfing in Java.

``public class A{public static void main(String[]a){for(int i=0;i<26;i++){for(int j=0;j<25-i;j++)System.out.print(" ");for(char c=(char)(90-i);c>=65;c--)System.out.print(c);System.out.println();}}}```

Thanks to JollyJoker for suggesting improvements. I won't get a chance to investigate lambdas for this one, but I'll remember it for the future. This is as short as I'll make this one. Eclipse kept complaining when I changed all ints to chars, so I'll look into that some more.

String() a(){String r="";for(int i=0;i<26;i++){for(int j=0;j<25-i;j++)r+=" ";for(char c=(char)('Z'-i);c>=65;c--)r+=c;r+="\n";}return r;}

Ungolfed:

public class A { public static void main(String[] args) { for (int i = 0; i < 26; i++) { for (int j = 0; j < 25 - i; j++) System.out.print(" "); for (char c = (char)(90 - i); c> = 65; c--) System.out.print(c); System.out.println(); } } }

String() a() {
    String r = "";
    for (int i = 0; i < 26; i++) {
        for (int j = 0; j < 25 - i; j++)
            r += " ";
        for (char c = (char)('Z'-i); c >= 65; c--)
            r += c; r+= "\n";
    }
    return r;
}

Java, 196 136 bytes

Yes, this has no chance of winning overall, but it helps to re-familiarize myself with the language. Any improvements are welcome, but know I have not yet had time to read the Tips or Golfing in Java.

``public class A{public static void main(String[]a){for(int i=0;i<26;i++){for(int j=0;j<25-i;j++)System.out.print(" ");for(char c=(char)(90-i);c>=65;c--)System.out.print(c);System.out.println();}}}```

Thanks to JollyJoker for suggesting improvements. I won't get a chance to investigate lambdas for this one, but I'll remember it for the future. This is as short as I'll make this one. Eclipse kept complaining when I changed all ints to chars, so I'll look into that some more.

String() a(){String r="";for(int i=0;i<26;i++){for(int j=0;j<25-i;j++)r+=" ";for(char c=(char)('Z'-i);c>=65;c--)r+=c;r+="\n";}return r;}

Ungolfed:

public class A { public static void main(String[] args) { for (int i = 0; i < 26; i++) { for (int j = 0; j < 25 - i; j++) System.out.print(" "); for (char c = (char)(90 - i); c> = 65; c--) System.out.print(c); System.out.println(); } } }

String() a() {
    String r = "";
    for (int i = 0; i < 26; i++) {
        for (int j = 0; j < 25 - i; j++)
            r += " ";
        for (char c = (char)('Z'-i); c >= 65; c--)
            r += c; r+= "\n";
    }
    return r;
}

Java, 196 136 bytes

Yes, this has no chance of winning overall, but it helps to re-familiarize myself with the language. Any improvements are welcome, but know I have not yet had time to read the Tips or Golfing in Java.

``public class A{public static void main(String[]a){for(int i=0;i<26;i++){for(int j=0;j<25-i;j++)System.out.print(" ");for(char c=(char)(90-i);c>=65;c--)System.out.print(c);System.out.println();}}}```

Thanks to JollyJoker for suggesting improvements. I won't get a chance to investigate lambdas for this one, but I'll remember it for the future. This is as short as I'll make this one. Eclipse kept complaining when I changed all ints to chars, so I'll look into that some more.

String a(){String r="";for(int i=0;i<26;i++){for(int j=0;j<25-i;j++)r+=" ";for(char c=(char)('Z'-i);c>=65;c--)r+=c;r+="\n";}return r;}

Ungolfed:

public class A { public static void main(String[] args) { for (int i = 0; i < 26; i++) { for (int j = 0; j < 25 - i; j++) System.out.print(" "); for (char c = (char)(90 - i); c> = 65; c--) System.out.print(c); System.out.println(); } } }

String a() {
    String r = "";
    for (int i = 0; i < 26; i++) {
        for (int j = 0; j < 25 - i; j++)
            r += " ";
        for (char c = (char)('Z'-i); c >= 65; c--)
            r += c; r+= "\n";
    }
    return r;
}
added 758 characters in body
Source Link
Loading
Source Link
Loading