Skip to main content
Code Golf

Return to Answer

deleted 513 characters in body
Source Link
Miriam
  • 843
  • 7
  • 19

Python 3, 90(削除) 90 (削除ここまで) 83 bytes

deflambda f(n):'\n'.join([' for'*i+'\\'for i in range(n):print(']+[' '*i+'\\''*(n+~i)
 for+'/'for i in range(n-1,-1,-1):print(' '*i+'/'])

Try it online! Try it online!

Not very clever but it's the best I could come up with. Here's a slightly nicer version that's 12-7 bytes longer:

Python 3 , 102 bytes

def f(n):a=[' '*i+'\\'for i in range(n)];b=[i.replace('\\','/')for i in a[::-1]];print(*a,*b,sep='\n')

Try it online! thanks to @squid

Python 3, 90 bytes

def f(n): for i in range(n):print(' '*i+'\\')
 for i in range(n-1,-1,-1):print(' '*i+'/')

Try it online!

Not very clever but it's the best I could come up with. Here's a slightly nicer version that's 12 bytes longer:

Python 3 , 102 bytes

def f(n):a=[' '*i+'\\'for i in range(n)];b=[i.replace('\\','/')for i in a[::-1]];print(*a,*b,sep='\n')

Try it online!

Python 3, (削除) 90 (削除ここまで) 83 bytes

lambda n:'\n'.join([' '*i+'\\'for i in range(n)]+[' '*(n+~i)+'/'for i in range(n)])

Try it online!

-7 bytes thanks to @squid

added 510 characters in body
Source Link
Miriam
  • 843
  • 7
  • 19

Python 3, 90 bytes

def f(n):
 for i in range(n):print(' '*i+'\\')
 for i in range(n-1,-1,-1):print(' '*i+'/')

Try it online!

Not very clever but it's the best I could come up with. Here's a slightly nicer version that's 12 bytes longer:

Python 3 , 102 bytes

def f(n):a=[' '*i+'\\'for i in range(n)];b=[i.replace('\\','/')for i in a[::-1]];print(*a,*b,sep='\n')

Try it online!

Python 3, 90 bytes

def f(n):
 for i in range(n):print(' '*i+'\\')
 for i in range(n-1,-1,-1):print(' '*i+'/')

Try it online!

Not very clever but it's the best I could come up with.

Python 3, 90 bytes

def f(n):
 for i in range(n):print(' '*i+'\\')
 for i in range(n-1,-1,-1):print(' '*i+'/')

Try it online!

Not very clever but it's the best I could come up with. Here's a slightly nicer version that's 12 bytes longer:

Python 3 , 102 bytes

def f(n):a=[' '*i+'\\'for i in range(n)];b=[i.replace('\\','/')for i in a[::-1]];print(*a,*b,sep='\n')

Try it online!

added 283 characters in body
Source Link
Miriam
  • 843
  • 7
  • 19

Python 3Python 3, 8990 bytes

def f(n):
 for i in range(n):print(' '*i+'\\')
 for i in range(n-1,-1,-1):print(' '*i+'/')
def f(n):
 for i in range(n):print(' '*i+'\\')
 for i in range(n-1,-1,-1):print(' '*i+'/')

Try it online!

Not very clever but it's the best I could come up with.

Python 3, 89 bytes

def f(n):
 for i in range(n):print(' '*i+'\\')
 for i in range(n-1,-1,-1):print(' '*i+'/')

Not very clever but it's the best I could come up with.

Python 3, 90 bytes

def f(n):
 for i in range(n):print(' '*i+'\\')
 for i in range(n-1,-1,-1):print(' '*i+'/')

Try it online!

Not very clever but it's the best I could come up with.

Source Link
Miriam
  • 843
  • 7
  • 19
Loading

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