Skip to main content
Commonmark migration
Source Link

#Java 169 156bytes

Java 169 156bytes

String a="abcdefghijklmnopqrstuvwxyz";
public void alphabetTriangle(){
  for(int i=0;++i<27;){
    System.out.println(a.substring(0,a)+new StringBuilder(a).reverse().substring(1,-i+1));
  }
}

Golfed

String a="abcdefghijklmnopqrstuvwxyz";void l(){for(int i=0;++i<27;){System.out.println(a.substring(0,a)+new StringBuilder(a).reverse().substring(1,-i+1));}}

It is actually same as the batch solution with some shortcuts

Thanks to @Value Ink for saving 15 bytes by shortening the method name.

#Java 169 156bytes

String a="abcdefghijklmnopqrstuvwxyz";
public void alphabetTriangle(){
  for(int i=0;++i<27;){
    System.out.println(a.substring(0,a)+new StringBuilder(a).reverse().substring(1,-i+1));
  }
}

Golfed

String a="abcdefghijklmnopqrstuvwxyz";void l(){for(int i=0;++i<27;){System.out.println(a.substring(0,a)+new StringBuilder(a).reverse().substring(1,-i+1));}}

It is actually same as the batch solution with some shortcuts

Thanks to @Value Ink for saving 15 bytes by shortening the method name.

Java 169 156bytes

String a="abcdefghijklmnopqrstuvwxyz";
public void alphabetTriangle(){
  for(int i=0;++i<27;){
    System.out.println(a.substring(0,a)+new StringBuilder(a).reverse().substring(1,-i+1));
  }
}

Golfed

String a="abcdefghijklmnopqrstuvwxyz";void l(){for(int i=0;++i<27;){System.out.println(a.substring(0,a)+new StringBuilder(a).reverse().substring(1,-i+1));}}

It is actually same as the batch solution with some shortcuts

Thanks to @Value Ink for saving 15 bytes by shortening the method name.

added 4 characters in body
Source Link
Linnea Gräf
  • 3.1k
  • 16
  • 35

#Java 169 154bytes156bytes

String a="abcdefghijklmnopqrstuvwxyz";
public void alphabetTriangle(){
  for(int i=0;++i<27;){
    System.out.println(a.substring(0,a)+new StringBuilder(a).reverse().substring(1,-i+1));
  }
}

Golfed

String a="abcdefghijklmnopqrstuvwxyz";void l(){for(int i=0;++i<27;){System.out.println(a.substring(0,a)+new StringBuilder(a).reverse().substring(1,-i+1));}}

It is actually same as the batch solution with some shortcuts

Thanks to @Value Ink for saving 15 bytes by shortening the method name.

#Java 169 154bytes

String a="abcdefghijklmnopqrstuvwxyz";
public void alphabetTriangle(){
  for(int i=0;++i<27;){
    System.out.println(a.substring(0,a)+new StringBuilder(a).reverse.substring(1,-i+1));
  }
}

Golfed

String a="abcdefghijklmnopqrstuvwxyz";void l(){for(int i=0;++i<27;){System.out.println(a.substring(0,a)+new StringBuilder(a).reverse.substring(1,-i+1));}}

It is actually same as the batch solution with some shortcuts

Thanks to @Value Ink for saving 15 bytes by shortening the method name.

#Java 169 156bytes

String a="abcdefghijklmnopqrstuvwxyz";
public void alphabetTriangle(){
  for(int i=0;++i<27;){
    System.out.println(a.substring(0,a)+new StringBuilder(a).reverse().substring(1,-i+1));
  }
}

Golfed

String a="abcdefghijklmnopqrstuvwxyz";void l(){for(int i=0;++i<27;){System.out.println(a.substring(0,a)+new StringBuilder(a).reverse().substring(1,-i+1));}}

It is actually same as the batch solution with some shortcuts

Thanks to @Value Ink for saving 15 bytes by shortening the method name.

added 68 characters in body
Source Link
Linnea Gräf
  • 3.1k
  • 16
  • 35

#Java 169 bytes169 154bytes

String a="abcdefghijklmnopqrstuvwxyz";
public void alphabetTriangle(){
  for(int i=0;++i<27;){
    System.out.println(a.substring(0,a)+new StringBuilder(a).reverse.substring(1,-i+1));
  }
}

Golfed

String a="abcdefghijklmnopqrstuvwxyz";void alphabetTrianglel(){for(int i=0;++i<27;){System.out.println(a.substring(0,a)+new StringBuilder(a).reverse.substring(1,-i+1));}}

It is actually same as the batch solution with some shortcuts

Thanks to @Value Ink for saving 15 bytes by shortening the method name.

#Java 169 bytes

String a="abcdefghijklmnopqrstuvwxyz";
public void alphabetTriangle(){
  for(int i=0;++i<27;){
    System.out.println(a.substring(0,a)+new StringBuilder(a).reverse.substring(1,-i+1));
  }
}

Golfed

String a="abcdefghijklmnopqrstuvwxyz";void alphabetTriangle(){for(int i=0;++i<27;){System.out.println(a.substring(0,a)+new StringBuilder(a).reverse.substring(1,-i+1));}}

It is actually same as the batch solution with some shortcuts

#Java 169 154bytes

String a="abcdefghijklmnopqrstuvwxyz";
public void alphabetTriangle(){
  for(int i=0;++i<27;){
    System.out.println(a.substring(0,a)+new StringBuilder(a).reverse.substring(1,-i+1));
  }
}

Golfed

String a="abcdefghijklmnopqrstuvwxyz";void l(){for(int i=0;++i<27;){System.out.println(a.substring(0,a)+new StringBuilder(a).reverse.substring(1,-i+1));}}

It is actually same as the batch solution with some shortcuts

Thanks to @Value Ink for saving 15 bytes by shortening the method name.

Source Link
Linnea Gräf
  • 3.1k
  • 16
  • 35
Loading