Skip to main content
Commonmark migration
Source Link

#Java 8, 719 bytes

Java 8, 719 bytes

#Java 8, 719 bytes

Java 8, 719 bytes

Bug-fix
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384
u->{String a="______________";return r(" _"+a,"_")+r("||    x         ","|")+r("||     x       /","|")+r("||     /x'.__.' ",":")+r("|| __.'  x      ","|")+r("||'.     /x'---'",":")+r("||x '. /'  x__ _","|")+r("|| |  /.   /x ' ", ":")+r("|| |  | './  x _","|")+r("||/ '/.  /'. // ","|")+r("||__/___/___/_x","(+)")+r("||  x   x.   x /","(O)")+r("||x .x'  x.' xx_",":")+r("|| |  | .'x  /  ","|")+r("|| |  x'   x/_._",":")+r("||/ .' x   /    ","|")+r("||.'_   'x/.---.",":")+r("||   '.  / __   ","|")+r("||     x/.'  '. ",":")+r("||     /       x","|")+r("||____/_________",":")+r("|/"+a,"_");}String r(String a,String b){return a.replace("x","\\")+b+(new StringBuffer(a).reverse()+"\n").replace("/","\\").replace("x","/");}

Try it here.Try it here.

u->{                          // Method (1) with unused Object parameter and String return-type
  String a="______________";  //  Temp String we use multiple times
  return r(" _"+a,"_")+r("||    x         ","|")+r("||     x       /","|")+r("||     /x'.__.' ",":")+r("|| __.'  x      ","|")+r("||'.     /x'---'",":")+r("||x '. /'  x__ _","|")+r("|| |  /.   /x ' ", ":")+r("|| |  | './  x _","|")+r("||/ '/.  /'. // ","|")+r("||__/___/___/_x","(+)")+r("||  x   x.   x /","(O)")+r("||x .x'  x.' xx_",":")+r("|| |  | .'x  /  ","|")+r("|| |  x'   x/_._",":")+r("||/ .' x   /    ","|")+r("||.'_   'x/.---.",":")+r("||   '.  / __   ","|")+r("||     x/.'  '. ",":")+r("||     /       x","|")+r("||____/_________",":")+r("|/"+a,"_");
                              //  Return the result
}                             // End of method (1)

String r(String a,String b){  // Method (2) with two String parameters and String return-type
  return a.replace("x","\\")  //  Return the first halve of the row
         +b                   //   + the middle character(s)
         +(new StringBuffer(a).reverse()+"\n").replace("/","\\").replace("x","/");
                              //   + the reversed first halve
}                             //  End of method (2)
u->{String a="______________";return r(" _"+a,"_")+r("||    x         ","|")+r("||     x       /","|")+r("||     /x'.__.' ",":")+r("|| __.'  x      ","|")+r("||'.     /x'---'",":")+r("||x '. /'  x__ _","|")+r("|| |  /.   /x ' ", ":")+r("|| |  | './  x _","|")+r("||/ '/.  /'. // ","|")+r("||__/___/___/_x","(+)")+r("||  x   x.  x /","(O)")+r("||x .x'  x.' xx_",":")+r("|| |  | .'x  /  ","|")+r("|| |  x'   x/_._",":")+r("||/ .' x   /    ","|")+r("||.'_   'x/.---.",":")+r("||   '.  / __   ","|")+r("||     x/.'  '. ",":")+r("||     /       x","|")+r("||____/_________",":")+r("|/"+a,"_");}String r(String a,String b){return a.replace("x","\\")+b+(new StringBuffer(a).reverse()+"\n").replace("/","\\").replace("x","/");}

Try it here.

u->{                          // Method (1) with unused Object parameter and String return-type
  String a="______________";  //  Temp String we use multiple times
  return r(" _"+a,"_")+r("||    x         ","|")+r("||     x       /","|")+r("||     /x'.__.' ",":")+r("|| __.'  x      ","|")+r("||'.     /x'---'",":")+r("||x '. /'  x__ _","|")+r("|| |  /.   /x ' ", ":")+r("|| |  | './  x _","|")+r("||/ '/.  /'. // ","|")+r("||__/___/___/_x","(+)")+r("||  x   x.  x /","(O)")+r("||x .x'  x.' xx_",":")+r("|| |  | .'x  /  ","|")+r("|| |  x'   x/_._",":")+r("||/ .' x   /    ","|")+r("||.'_   'x/.---.",":")+r("||   '.  / __   ","|")+r("||     x/.'  '. ",":")+r("||     /       x","|")+r("||____/_________",":")+r("|/"+a,"_");
                              //  Return the result
}                             // End of method (1)

String r(String a,String b){  // Method (2) with two String parameters and String return-type
  return a.replace("x","\\")  //  Return the first halve of the row
         +b                   //   + the middle character(s)
         +(new StringBuffer(a).reverse()+"\n").replace("/","\\").replace("x","/");
                              //   + the reversed first halve
}                             //  End of method (2)
u->{String a="______________";return r(" _"+a,"_")+r("||    x         ","|")+r("||     x       /","|")+r("||     /x'.__.' ",":")+r("|| __.'  x      ","|")+r("||'.     /x'---'",":")+r("||x '. /'  x__ _","|")+r("|| |  /.   /x ' ", ":")+r("|| |  | './  x _","|")+r("||/ '/.  /'. // ","|")+r("||__/___/___/_x","(+)")+r("||  x   x   x /","(O)")+r("||x .x'  x.' xx_",":")+r("|| |  | .'x  /  ","|")+r("|| |  x'   x/_._",":")+r("||/ .' x   /    ","|")+r("||.'_   'x/.---.",":")+r("||   '.  / __   ","|")+r("||     x/.'  '. ",":")+r("||     /       x","|")+r("||____/_________",":")+r("|/"+a,"_");}String r(String a,String b){return a.replace("x","\\")+b+(new StringBuffer(a).reverse()+"\n").replace("/","\\").replace("x","/");}

Try it here.

u->{                          // Method (1) with unused Object parameter and String return-type
  String a="______________";  //  Temp String we use multiple times
  return r(" _"+a,"_")+r("||    x         ","|")+r("||     x       /","|")+r("||     /x'.__.' ",":")+r("|| __.'  x      ","|")+r("||'.     /x'---'",":")+r("||x '. /'  x__ _","|")+r("|| |  /.   /x ' ", ":")+r("|| |  | './  x _","|")+r("||/ '/.  /'. // ","|")+r("||__/___/___/_x","(+)")+r("||  x   x   x /","(O)")+r("||x .x'  x.' xx_",":")+r("|| |  | .'x  /  ","|")+r("|| |  x'   x/_._",":")+r("||/ .' x   /    ","|")+r("||.'_   'x/.---.",":")+r("||   '.  / __   ","|")+r("||     x/.'  '. ",":")+r("||     /       x","|")+r("||____/_________",":")+r("|/"+a,"_");
                              //  Return the result
}                             // End of method (1)

String r(String a,String b){  // Method (2) with two String parameters and String return-type
  return a.replace("x","\\")  //  Return the first halve of the row
         +b                   //   + the middle character(s)
         +(new StringBuffer(a).reverse()+"\n").replace("/","\\").replace("x","/");
                              //   + the reversed first halve
}                             //  End of method (2)
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384

#Java 8, 719 bytes

u->{String a="______________";return r(" _"+a,"_")+r("||    x         ","|")+r("||     x       /","|")+r("||     /x'.__.' ",":")+r("|| __.'  x      ","|")+r("||'.     /x'---'",":")+r("||x '. /'  x__ _","|")+r("|| |  /.   /x ' ", ":")+r("|| |  | './  x _","|")+r("||/ '/.  /'. // ","|")+r("||__/___/___/_x","(+)")+r("||  x   x.  x /","(O)")+r("||x .x'  x.' xx_",":")+r("|| |  | .'x  /  ","|")+r("|| |  x'   x/_._",":")+r("||/ .' x   /    ","|")+r("||.'_   'x/.---.",":")+r("||   '.  / __   ","|")+r("||     x/.'  '. ",":")+r("||     /       x","|")+r("||____/_________",":")+r("|/"+a,"_");}String r(String a,String b){return a.replace("x","\\")+b+(new StringBuffer(a).reverse()+"\n").replace("/","\\").replace("x","/");}

Can definitely be golfed, but it's just a start and something other Java golfers can (try to) beat. ;)

Explanation:

Try it here.

u->{                          // Method (1) with unused Object parameter and String return-type
  String a="______________";  //  Temp String we use multiple times
  return r(" _"+a,"_")+r("||    x         ","|")+r("||     x       /","|")+r("||     /x'.__.' ",":")+r("|| __.'  x      ","|")+r("||'.     /x'---'",":")+r("||x '. /'  x__ _","|")+r("|| |  /.   /x ' ", ":")+r("|| |  | './  x _","|")+r("||/ '/.  /'. // ","|")+r("||__/___/___/_x","(+)")+r("||  x   x.  x /","(O)")+r("||x .x'  x.' xx_",":")+r("|| |  | .'x  /  ","|")+r("|| |  x'   x/_._",":")+r("||/ .' x   /    ","|")+r("||.'_   'x/.---.",":")+r("||   '.  / __   ","|")+r("||     x/.'  '. ",":")+r("||     /       x","|")+r("||____/_________",":")+r("|/"+a,"_");
                              //  Return the result
}                             // End of method (1)

String r(String a,String b){  // Method (2) with two String parameters and String return-type
  return a.replace("x","\\")  //  Return the first halve of the row
         +b                   //   + the middle character(s)
         +(new StringBuffer(a).reverse()+"\n").replace("/","\\").replace("x","/");
                              //   + the reversed first halve
}                             //  End of method (2)