Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

Python 3, 60 bytes

#Python 3, 60 bytes A Function

def p(a,b,c,d,e):q=c+e*(a-2)+c;return(q+'\n'+(d+'\n')*b)*2+q

Test Case

>>> print(p(8,2,'+','|','#'))
+######+
|
|
+######+
|
|
+######+

#Python 3, 60 bytes A Function

def p(a,b,c,d,e):q=c+e*(a-2)+c;return(q+'\n'+(d+'\n')*b)*2+q

Test Case

>>> print(p(8,2,'+','|','#'))
+######+
|
|
+######+
|
|
+######+

Python 3, 60 bytes

A Function

def p(a,b,c,d,e):q=c+e*(a-2)+c;return(q+'\n'+(d+'\n')*b)*2+q

Test Case

>>> print(p(8,2,'+','|','#'))
+######+
|
|
+######+
|
|
+######+
corrected code
Source Link

#Python 3, 60 bytes A Function

def xp(ha,vb,c,f,d,e):t=c+d*h+c+"\n";f=q=c+e*(f+"\n"a-2)*v;return+c;return(t+fq+'\n'+(d+'\n')*2+t*b)*2+q

Test Case

>>> print(xp(8,2,'+','|','#'))
+########++######+
|
|
+########++######+
|
|
+########++######+

#Python 3, 60 bytes A Function

def x(h,v,c,f,d):t=c+d*h+c+"\n";f=(f+"\n")*v;return(t+f)*2+t

Test Case

>>> print(x(8,2,'+','|','#'))
+########+
|
|
+########+
|
|
+########+

#Python 3, 60 bytes A Function

def p(a,b,c,d,e):q=c+e*(a-2)+c;return(q+'\n'+(d+'\n')*b)*2+q

Test Case

>>> print(p(8,2,'+','|','#'))
+######+
|
|
+######+
|
|
+######+
Source Link

#Python 3, 60 bytes A Function

def x(h,v,c,f,d):t=c+d*h+c+"\n";f=(f+"\n")*v;return(t+f)*2+t

Test Case

>>> print(x(8,2,'+','|','#'))
+########+
|
|
+########+
|
|
+########+

AltStyle によって変換されたページ (->オリジナル) /