fork download
  1. public class Main{static String k(String s){return s.replaceAll("...$","\n");}static java.util.function.Function<Integer,java.util.function.Function<Integer,String>>C=
  2.  
  3. p->q->{int c=0,l=0,s[]=new int[p*q],i=0,j,t,b;java.util.List e=new java.util.Stack();String v="TJQK",o="",n[]=new String[p*q],x=o,z;for(;i<p;x+=v)o+="Player "+i+++" | ";o=k(o);for(i=-1;++i<q;o=k(k(o)+x.replace(v,"'------' | "))){o=k(o+x.replace(v,".------. | "));for(j=p;j-->0;o+="|2.--. | | ".replace("2",n[c++])){for(;e.contains(z=(t=(int)(Math.random()*13))+""+v.charAt(b=(int)(Math.random()*4))););e.add(z);s[c]=b;n[c]=t<1?"A":t<9?++t+"":""+v.charAt(t-9);}for(o=k(o);++j<p;o+="| "+(t<1?"(\\/)":t<3?":/\\:":":():")+" | | ")t=s[l++];for(o=k(o);j-->0;o+="| "+(t<2?":\\/:":t<3?"(__)":"()()")+" | | ")t=s[i*p+j];for(o=k(o);++j<p;)o+="| '--'2| | ".replace("2",n[i*p+j]);}return o;}
  4.  
  5. ;public static void main(String[]a){System.out.print(C.apply(5).apply(5));}}
Success #stdin #stdout 0.3s 38764KB
stdin
Standard input is empty
stdout
Player 0 | Player 1 | Player 2 | Player 3 | Player 4
.------. | .------. | .------. | .------. | .------.
|5.--. | | |A.--. | | |5.--. | | |2.--. | | |7.--. |
| :/\: | | | (\/) | | | (\/) | | | (\/) | | | :(): |
| ()() | | | :\/: | | | :\/: | | | :\/: | | | (__) |
| '--'5| | | '--'A| | | '--'5| | | '--'2| | | '--'7|
'------' | '------' | '------' | '------' | '------'
.------. | .------. | .------. | .------. | .------.
|T.--. | | |T.--. | | |J.--. | | |K.--. | | |2.--. |
| :(): | | | :/\: | | | :/\: | | | :(): | | | :/\: |
| (__) | | | ()() | | | :\/: | | | (__) | | | ()() |
| '--'T| | | '--'T| | | '--'J| | | '--'K| | | '--'2|
'------' | '------' | '------' | '------' | '------'
.------. | .------. | .------. | .------. | .------.
|8.--. | | |A.--. | | |Q.--. | | |5.--. | | |J.--. |
| (\/) | | | :/\: | | | (\/) | | | :(): | | | :(): |
| ()() | | | ()() | | | :\/: | | | :\/: | | | :\/: |
| '--'8| | | '--'A| | | '--'Q| | | '--'5| | | '--'J|
'------' | '------' | '------' | '------' | '------'
.------. | .------. | .------. | .------. | .------.
|6.--. | | |A.--. | | |4.--. | | |3.--. | | |6.--. |
| :(): | | | :/\: | | | :(): | | | :/\: | | | :/\: |
| (__) | | | :\/: | | | ()() | | | (__) | | | ()() |
| '--'6| | | '--'A| | | '--'4| | | '--'3| | | '--'6|
'------' | '------' | '------' | '------' | '------'
.------. | .------. | .------. | .------. | .------.
|3.--. | | |2.--. | | |J.--. | | |9.--. | | |7.--. |
| (\/) | | | :(): | | | (\/) | | | (\/) | | | :/\: |
| :\/: | | | :\/: | | | :\/: | | | ()() | | | :\/: |
| '--'3| | | '--'2| | | '--'J| | | '--'9| | | '--'7|
'------' | '------' | '------' | '------' | '------'