Skip to main content
Commonmark migration
Source Link

#Java 8, 84 bytes

Java 8, 84 bytes

o->{String r="";for(int x=0,y;++x<11;r+="\n")for(y=0;++y<11;r+=x*y%11%10);return r;}

Uses the same algorithm as @MartinEnder's Mathematica answer: 1-indexed x*y%11%10.

Explanation:

Try it here.

o->{                     // Unused Object parameter and String return-type
  String r="";           //  Result-String
  for(int x=0,y;++x<11;  //  Loop (1) from 1 to 11 (exclusive)
      r+="\n")           //    And append a new-line after every iteration
    for(y=0;++y<11;      //   Inner loop (2) from 1 to 11 (exclusive)
      r+=x*y%11%10       //    And append the result-String with `x*y%11%10`
    );                   //   End of inner loop (2)
                         //  End of loop (1) (implicit / single-line body)
  return r;              //  Return result-String
}                        // End of method

#Java 8, 84 bytes

o->{String r="";for(int x=0,y;++x<11;r+="\n")for(y=0;++y<11;r+=x*y%11%10);return r;}

Uses the same algorithm as @MartinEnder's Mathematica answer: 1-indexed x*y%11%10.

Explanation:

Try it here.

o->{                     // Unused Object parameter and String return-type
  String r="";           //  Result-String
  for(int x=0,y;++x<11;  //  Loop (1) from 1 to 11 (exclusive)
      r+="\n")           //    And append a new-line after every iteration
    for(y=0;++y<11;      //   Inner loop (2) from 1 to 11 (exclusive)
      r+=x*y%11%10       //    And append the result-String with `x*y%11%10`
    );                   //   End of inner loop (2)
                         //  End of loop (1) (implicit / single-line body)
  return r;              //  Return result-String
}                        // End of method

Java 8, 84 bytes

o->{String r="";for(int x=0,y;++x<11;r+="\n")for(y=0;++y<11;r+=x*y%11%10);return r;}

Uses the same algorithm as @MartinEnder's Mathematica answer: 1-indexed x*y%11%10.

Explanation:

Try it here.

o->{                     // Unused Object parameter and String return-type
  String r="";           //  Result-String
  for(int x=0,y;++x<11;  //  Loop (1) from 1 to 11 (exclusive)
      r+="\n")           //    And append a new-line after every iteration
    for(y=0;++y<11;      //   Inner loop (2) from 1 to 11 (exclusive)
      r+=x*y%11%10       //    And append the result-String with `x*y%11%10`
    );                   //   End of inner loop (2)
                         //  End of loop (1) (implicit / single-line body)
  return r;              //  Return result-String
}                        // End of method
Source Link
Kevin Cruijssen
  • 131.5k
  • 13
  • 144
  • 384

#Java 8, 84 bytes

o->{String r="";for(int x=0,y;++x<11;r+="\n")for(y=0;++y<11;r+=x*y%11%10);return r;}

Uses the same algorithm as @MartinEnder's Mathematica answer: 1-indexed x*y%11%10.

Explanation:

Try it here.

o->{                     // Unused Object parameter and String return-type
  String r="";           //  Result-String
  for(int x=0,y;++x<11;  //  Loop (1) from 1 to 11 (exclusive)
      r+="\n")           //    And append a new-line after every iteration
    for(y=0;++y<11;      //   Inner loop (2) from 1 to 11 (exclusive)
      r+=x*y%11%10       //    And append the result-String with `x*y%11%10`
    );                   //   End of inner loop (2)
                         //  End of loop (1) (implicit / single-line body)
  return r;              //  Return result-String
}                        // End of method